summaryrefslogtreecommitdiff
path: root/libavcodec/nuv.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-02-27 15:17:12 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-03-12 01:32:42 +0100
commit939440ad1aa820bed51f54d273b4fa6c5016d9f9 (patch)
treedc1d19dfbfe8c3ddaee62c6c2ebfb91e15b3ed50 /libavcodec/nuv.c
parent8ee3265dbe2e85537affe3b3055b00ba8646aa70 (diff)
downloadffmpeg-939440ad1aa820bed51f54d273b4fa6c5016d9f9.tar.gz
avcodec/nuv: rtjpeg with dimensions less than 16 would result in no decoded pixels thus reject it
Fixes: Timeout Fixes: 6297/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_NUV_fuzzer-4882404863901696 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/nuv.c')
-rw-r--r--libavcodec/nuv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c
index 8d806dbbff..32ed65899b 100644
--- a/libavcodec/nuv.c
+++ b/libavcodec/nuv.c
@@ -199,6 +199,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
case NUV_RTJPEG_IN_LZO:
case NUV_RTJPEG:
keyframe = !buf[2];
+ if (c->width < 16 || c->height < 16) {
+ return AVERROR_INVALIDDATA;
+ }
break;
case NUV_COPY_LAST:
keyframe = 0;