[FFmpeg-cvslog] avcodec/wnv1: Check for width =1
Michael Niedermayer
git at videolan.org
Mon Sep 26 01:23:04 EEST 2022
ffmpeg | branch: release/4.4 | Michael Niedermayer <michael at niedermayer.cc> | Sun Jul 3 02:31:47 2022 +0200| [8f9b6ac0e88fc7fc3eb75a19e745542c451f6e71] | committer: Michael Niedermayer
avcodec/wnv1: Check for width =1
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 at niedermayer.cc>
(cherry picked from commit d98d5a436aa70d3cef8f914c0467ef2fb2dd1dfc)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8f9b6ac0e88fc7fc3eb75a19e745542c451f6e71
---
libavcodec/wnv1.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c
index dcf417763c..fd9721f4ca 100644
--- a/libavcodec/wnv1.c
+++ b/libavcodec/wnv1.c
@@ -126,6 +126,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
{
static AVOnce init_static_once = AV_ONCE_INIT;
+ if (avctx->width <= 1)
+ return AVERROR_INVALIDDATA;
+
avctx->pix_fmt = AV_PIX_FMT_YUV422P;
ff_thread_once(&init_static_once, wnv1_init_static);
More information about the ffmpeg-cvslog
mailing list