Message ID | 20220703003152.17850-1-michael@niedermayer.cc |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel,1/6] avcodec/wnv1: Check for width =1 | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
Michael Niedermayer: > The decoder only outputs pixels for width >1 images, fail early > > Fixes: Timeout > Fixes: 48298/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WNV1_fuzzer-6198626319204352 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > --- > libavcodec/wnv1.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c > index 0cf2181a48..f1223493fe 100644 > --- a/libavcodec/wnv1.c > +++ b/libavcodec/wnv1.c > @@ -129,6 +129,9 @@ static av_cold int decode_init(AVCodecContext *avctx) > > ff_thread_once(&init_static_once, wnv1_init_static); > > + if (avctx->width <= 1) > + return AVERROR_INVALIDDATA; > + > return 0; > } > If you want to fail early, then why don't you do so before initializing the static data? - Andreas
On Sun, Jul 03, 2022 at 08:38:15AM +0200, Andreas Rheinhardt wrote: > Michael Niedermayer: > > The decoder only outputs pixels for width >1 images, fail early > > > > Fixes: Timeout > > Fixes: 48298/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WNV1_fuzzer-6198626319204352 > > > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > > --- > > libavcodec/wnv1.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c > > index 0cf2181a48..f1223493fe 100644 > > --- a/libavcodec/wnv1.c > > +++ b/libavcodec/wnv1.c > > @@ -129,6 +129,9 @@ static av_cold int decode_init(AVCodecContext *avctx) > > > > ff_thread_once(&init_static_once, wnv1_init_static); > > > > + if (avctx->width <= 1) > > + return AVERROR_INVALIDDATA; > > + > > return 0; > > } > > > > If you want to fail early, then why don't you do so before initializing > the static data? "early" in the sense of costly operations causing timeouts but will apply with it moved up thx [...]
diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c index 0cf2181a48..f1223493fe 100644 --- a/libavcodec/wnv1.c +++ b/libavcodec/wnv1.c @@ -129,6 +129,9 @@ static av_cold int decode_init(AVCodecContext *avctx) ff_thread_once(&init_static_once, wnv1_init_static); + if (avctx->width <= 1) + return AVERROR_INVALIDDATA; + return 0; }
The decoder only outputs pixels for width >1 images, fail early Fixes: Timeout Fixes: 48298/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WNV1_fuzzer-6198626319204352 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavcodec/wnv1.c | 3 +++ 1 file changed, 3 insertions(+)