diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2022-07-03 02:31:47 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-10-21 22:19:37 +0200 |
commit | f3ac9f6f6948d194ca404145dad03f26113b09a1 (patch) | |
tree | 473322becc570c9ec9e49dba193a525e8baa3e31 /libavcodec | |
parent | 4b3ff3ce8ae77e0447a2cf30e45f4c841e366953 (diff) | |
download | ffmpeg-f3ac9f6f6948d194ca404145dad03f26113b09a1.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>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/wnv1.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c index 915e9c7dc9..291be78cc8 100644 --- a/libavcodec/wnv1.c +++ b/libavcodec/wnv1.c @@ -136,6 +136,9 @@ static av_cold int decode_init(AVCodecContext *avctx) { static VLC_TYPE code_table[1 << CODE_VLC_BITS][2]; + if (avctx->width <= 1) + return AVERROR_INVALIDDATA; + avctx->pix_fmt = AV_PIX_FMT_YUV422P; code_vlc.table = code_table; |