[FFmpeg-devel] [PATCH 2/2] avcodec/pngdec: Check nb_blocks

Michael Niedermayer michael at niedermayer.cc
Fri May 24 13:14:33 EEST 2019


On Sun, Apr 28, 2019 at 12:37:12PM +0200, Paul B Mahol wrote:
> On 4/28/19, Michael Niedermayer <michael at niedermayer.cc> wrote:
> > Fixes: Timeout (23sec -> 0.5sec)
> > Fixes:
> > 14329/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LSCR_fuzzer-5679252923482112
> >
> > 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/pngdec.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
> > index 6a681be29d..1dcde6cbc9 100644
> > --- a/libavcodec/pngdec.c
> > +++ b/libavcodec/pngdec.c
> > @@ -1541,6 +1541,8 @@ static int decode_frame_lscr(AVCodecContext *avctx,
> >          return ret;
> >
> >      nb_blocks = bytestream2_get_le16(gb);
> > +    if (2 + nb_blocks * 12 > bytestream2_get_bytes_left(gb))
> 
> I prefer if this is not reversed.

of course, will unreverse and push as "if (bytestream2_get_bytes_left(gb) < 2 + nb_blocks * 12)"

thanks

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

There will always be a question for which you do not know the correct answer.
-------------- 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/20190524/935a3bae/attachment.sig>


More information about the ffmpeg-devel mailing list