aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-09-14 20:16:27 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-06 13:59:34 +0200
commit838c34ec53342873df91403087cd8d7542a89c99 (patch)
treeb201269347859f27dc5b2df0932108f5e9358051 /libavcodec
parent01b228834a4f33c3054e6a3c06484fb4dd35770f (diff)
downloadffmpeg-838c34ec53342873df91403087cd8d7542a89c99.tar.gz
avcodec/mxpegdec: Check for AVDISCARD_ALL
Fixes: Fixes NULL pointer dereference Fixes: 36610/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MXPEG_fuzzer-6052641783283712 Fixes: 37907/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MXPEG_fuzzer-4725170850365440 Fixes: 37904/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MXPEG_fuzzer-6367889262247936 Fixes: 38085/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MXPEG_fuzzer-5175270823297024 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 20afd3a63a75a160f61a98a8dcfe06f527ea19b4) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mxpegdec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/mxpegdec.c b/libavcodec/mxpegdec.c
index f89226fefa..ea73bd4a10 100644
--- a/libavcodec/mxpegdec.c
+++ b/libavcodec/mxpegdec.c
@@ -195,6 +195,9 @@ static int mxpeg_decode_frame(AVCodecContext *avctx,
int start_code;
int ret;
+ if (avctx->skip_frame == AVDISCARD_ALL)
+ return AVERROR_PATCHWELCOME;
+
buf_ptr = buf;
buf_end = buf + buf_size;
jpg->got_picture = 0;