aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-07-03 02:31:47 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2022-09-01 00:41:28 +0200
commit048f3714c2ea2472e8cdd21b9e80ec4b5036c812 (patch)
tree5bd237e08afc93b346012299580e292061e1e5bc
parentae8aabe3989480caa1f9e256225f1a512d98ef2c (diff)
downloadffmpeg-048f3714c2ea2472e8cdd21b9e80ec4b5036c812.tar.gz
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@niedermayer.cc> (cherry picked from commit d98d5a436aa70d3cef8f914c0467ef2fb2dd1dfc) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/wnv1.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c
index 5d6c91d2d2..8fd5a732a5 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);