[FFmpeg-cvslog] avcodec/vp9_parser: set profile in AVCodecContext

James Almer git at videolan.org
Fri Oct 26 02:46:38 EEST 2018


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Thu Oct 25 20:45:45 2018 -0300| [bf324359be8d3f9981b9031af9005cf5cec23dd9] | committer: James Almer

avcodec/vp9_parser: set profile in AVCodecContext

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bf324359be8d3f9981b9031af9005cf5cec23dd9
---

 libavcodec/vp9_parser.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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;



More information about the ffmpeg-cvslog mailing list