[FFmpeg-devel] [PATCH 2/2] avcodec/cinepak: Check available input against encoded buffer size

Michael Niedermayer michael at niedermayer.cc
Tue May 14 12:57:33 EEST 2019


On Mon, May 13, 2019 at 02:32:11PM +0200, Tomas Härdin wrote:
> sön 2019-05-12 klockan 23:21 +0200 skrev Michael Niedermayer:
> > Fixes: Timeout (12sec -> 2sec)
> > Fixes: 14606/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CINEPAK_fuzzer-5738687561728000
> > 
> > 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/cinepak.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c
> > index a5132ddbc0..aeb15de0ed 100644
> > --- a/libavcodec/cinepak.c
> > +++ b/libavcodec/cinepak.c
> > @@ -323,6 +323,9 @@ static int cinepak_predecode_check (CinepakContext *s)
> >      num_strips  = AV_RB16 (&s->data[8]);
> >      encoded_buf_size = AV_RB24(&s->data[1]);
> >  
> > +    if (s->size < encoded_buf_size * (int64_t)(100 - s->avctx->discard_damaged_percentage) / 100)
> > +        return AVERROR_INVALIDDATA;
> 
> Looks OK

will apply

thx

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

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus
-------------- 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/20190514/897aaf3f/attachment.sig>


More information about the ffmpeg-devel mailing list