[FFmpeg-devel] [PATCH] avcodec/cpia: Check input size also against linesizes and EOL

Michael Niedermayer michael at niedermayer.cc
Mon May 20 20:13:02 EEST 2019


On Mon, May 20, 2019 at 10:14:46AM +0200, Carl Eugen Hoyos wrote:
> Am So., 19. Mai 2019 um 17:43 Uhr schrieb Michael Niedermayer
> <michael at niedermayer.cc>:
> >
> > Fixes: Timeout (14sec -> 29ms)
> > Fixes: 14733/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CPIA_fuzzer-5707022445576192
> >
> > 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/cpia.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/cpia.c b/libavcodec/cpia.c
> > index 119969389e..2e78fcff7a 100644
> > --- a/libavcodec/cpia.c
> > +++ b/libavcodec/cpia.c
> > @@ -63,7 +63,7 @@ static int cpia_decode_frame(AVCodecContext *avctx,
> >      uint8_t *y, *u, *v;
> >
> >      // Check header
> > -    if ( avpkt->size < FRAME_HEADER_SIZE
> > +    if ( avpkt->size < FRAME_HEADER_SIZE + avctx->height*3
> 
> lgtm except for the missing whitespace that is constantly present in the file.

add whitespace, will apply

thx

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

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA
-------------- 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/20190520/5419d97d/attachment.sig>


More information about the ffmpeg-devel mailing list