[FFmpeg-devel] [PATCH] avcodec/escape124: Check buf_size against num_superblocks

Michael Niedermayer michael at niedermayer.cc
Mon Jun 25 03:34:56 EEST 2018


On Sun, Jun 24, 2018 at 07:00:25PM -0300, James Almer wrote:
> On 6/24/2018 6:18 PM, Michael Niedermayer wrote:
> > Fixes: Timeout
> > Fixes: 8722/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ESCAPE124_fuzzer-4843268402577408
> > 
> > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> > ---
> >  libavcodec/escape124.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavcodec/escape124.c b/libavcodec/escape124.c
> > index eb051eba54..33c67e7754 100644
> > --- a/libavcodec/escape124.c
> > +++ b/libavcodec/escape124.c
> > @@ -221,7 +221,7 @@ static int escape124_decode_frame(AVCodecContext *avctx,
> >  
> >      // This call also guards the potential depth reads for the
> >      // codebook unpacking.
> > -    if (get_bits_left(&gb) < 64)
> > +    if (get_bits_left(&gb) < 64 + s->num_superblocks * 23LL / 4320)
> 
> An explanation of what these numbers and/or the overall check mean would
> help people reading this code in the future.

new patch sent with explanation

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are best at talking, realize last or never when they are wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180625/7d90d62a/attachment.sig>


More information about the ffmpeg-devel mailing list