diff options
author | James Almer <jamrial@gmail.com> | 2018-10-25 20:45:45 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2018-10-25 20:45:45 -0300 |
commit | bf324359be8d3f9981b9031af9005cf5cec23dd9 (patch) | |
tree | 179926ff2bd890aff9839737c7fe0c95b2f59c55 /libavcodec | |
parent | 963c16ed38fb7bb5a5d93c6cca6326ac6a53de6f (diff) | |
download | ffmpeg-bf324359be8d3f9981b9031af9005cf5cec23dd9.tar.gz |
avcodec/vp9_parser: set profile in AVCodecContext
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/vp9_parser.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/vp9_parser.c b/libavcodec/vp9_parser.c index 9531f34a32..c957a75667 100644 --- a/libavcodec/vp9_parser.c +++ b/libavcodec/vp9_parser.c @@ -36,12 +36,16 @@ static int parse(AVCodecParserContext *ctx, *out_data = data; *out_size = size; - if ((res = init_get_bits8(&gb, data, size)) < 0) + if (!size || (res = init_get_bits8(&gb, data, size)) < 0) return size; // parsers can't return errors get_bits(&gb, 2); // frame marker profile = get_bits1(&gb); profile |= get_bits1(&gb) << 1; if (profile == 3) profile += get_bits1(&gb); + if (profile > 3) + return size; + + avctx->profile = profile; if (get_bits1(&gb)) { keyframe = 0; |