diff mbox series

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

Message ID 20200530160541.29517-6-andreas.rheinhardt@gmail.com
State New
Headers show
Series [FFmpeg-devel,01/36] avcodec/vp9_superframe_bsf: Check for existence of data before reading it
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt May 30, 2020, 4:05 p.m. UTC
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@gmail.com>
---
 libavcodec/vp9_superframe_bsf.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

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);