[FFmpeg-devel] [PATCH 5/6] avcodec/hnm4video: Forward errors of decode_interframe_v4()

Michael Niedermayer michael at niedermayer.cc
Sat Aug 3 20:00:18 EEST 2019


On Sat, Aug 03, 2019 at 04:09:27PM +0200, Tomas Härdin wrote:
> lör 2019-08-03 klockan 01:49 +0200 skrev Michael Niedermayer:
> > Fixes: Timeout (108sec -> 160ms)
> > Fixes: 15570/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HNM4_VIDEO_fuzzer-5085482213441536
> > 
> > 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/hnm4video.c | 24 ++++++++++++++----------
> >  1 file changed, 14 insertions(+), 10 deletions(-)
> > 
> > diff --git a/libavcodec/hnm4video.c b/libavcodec/hnm4video.c
> > index 68d0baef6d..177ce1d47a 100644
> > --- a/libavcodec/hnm4video.c
> > +++ b/libavcodec/hnm4video.c
> > @@ -146,7 +146,7 @@ static void copy_processed_frame(AVCodecContext *avctx, AVFrame *frame)
> >      }
> >  }
> >  
> > -static void decode_interframe_v4(AVCodecContext *avctx, uint8_t *src, uint32_t size)
> > +static int decode_interframe_v4(AVCodecContext *avctx, uint8_t *src, uint32_t size)
> >  {
> > [...]
> > @@ -271,6 +272,7 @@ static void decode_interframe_v4(AVCodecContext *avctx, uint8_t *src, uint32_t s
> >              }
> >          }
> >      }
> > +    return 0;
> >  }
> >  
> >  static void decode_interframe_v4a(AVCodecContext *avctx, uint8_t *src,
> > @@ -438,7 +440,9 @@ static int hnm_decode_frame(AVCodecContext *avctx, void *data,
> >              decode_interframe_v4a(avctx, avpkt->data + 8, avpkt->size - 8);
> >              memcpy(hnm->processed, hnm->current, hnm->width * hnm->height);
> >          } else {
> > -            decode_interframe_v4(avctx, avpkt->data + 8, avpkt->size - 8);
> > +            int ret = decode_interframe_v4(avctx, avpkt->data + 8, avpkt->size - 8);
> > +            if (ret < 0)
> > +                return ret;
> 
> Looks OK

will apply

thanks

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

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato
-------------- 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/20190803/e361f61e/attachment.sig>


More information about the ffmpeg-devel mailing list