Message ID | 20180823213753.36856-1-rodger.combs@gmail.com |
---|---|
State | Withdrawn, archived |
Headers | show |
diff --git a/libavcodec/hevc_mp4toannexb_bsf.c b/libavcodec/hevc_mp4toannexb_bsf.c index 09bce5b34c..fb4ea34a93 100644 --- a/libavcodec/hevc_mp4toannexb_bsf.c +++ b/libavcodec/hevc_mp4toannexb_bsf.c @@ -52,6 +52,11 @@ static int hevc_extradata_to_annexb(AVBSFContext *ctx) num_arrays = bytestream2_get_byte(&gb); for (i = 0; i < num_arrays; i++) { + if (bytestream2_get_bytes_left(&gb) < 3) { + av_log(ctx, AV_LOG_WARNING, "Extradata contained fewer arrays than indicated\n"); + break; + } + int type = bytestream2_get_byte(&gb) & 0x3f; int cnt = bytestream2_get_be16(&gb);