[FFmpeg-devel] [PATCH 06/36] avcodec/vp9_superframe_bsf: Don't restrict packet size to INT_MAX/8

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Sat May 30 19:05:11 EEST 2020


by opening a GetBitContext on its data when all the info one cares about
is actually in the first byte of data.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
 libavcodec/vp9_superframe_bsf.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavcodec/vp9_superframe_bsf.c b/libavcodec/vp9_superframe_bsf.c
index a7faad3abf..29d1c759c7 100644
--- a/libavcodec/vp9_superframe_bsf.c
+++ b/libavcodec/vp9_superframe_bsf.c
@@ -135,8 +135,7 @@ static int vp9_superframe_filter(AVBSFContext *ctx, AVPacket *pkt)
         uses_superframe_syntax = pkt->size >= idx_sz && pkt->data[pkt->size - idx_sz] == marker;
     }
 
-    if ((res = init_get_bits8(&gb, pkt->data, pkt->size)) < 0)
-        goto done;
+    init_get_bits(&gb, pkt->data, 8);
 
     get_bits(&gb, 2); // frame marker
     profile  = get_bits1(&gb);
-- 
2.20.1



More information about the ffmpeg-devel mailing list