summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2018-10-25 20:45:45 -0300
committerJames Almer <jamrial@gmail.com>2018-10-25 20:45:45 -0300
commitbf324359be8d3f9981b9031af9005cf5cec23dd9 (patch)
tree179926ff2bd890aff9839737c7fe0c95b2f59c55 /libavcodec
parent963c16ed38fb7bb5a5d93c6cca6326ac6a53de6f (diff)
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.c6
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;