diff mbox series

[FFmpeg-devel,1/3] avcodec/mxpegdec: Check for AVDISCARD_ALL

Message ID 20210914205820.12598-1-michael@niedermayer.cc
State Accepted
Commit 20afd3a63a75a160f61a98a8dcfe06f527ea19b4
Headers show
Series [FFmpeg-devel,1/3] avcodec/mxpegdec: Check for AVDISCARD_ALL
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Michael Niedermayer Sept. 14, 2021, 8:58 p.m. UTC
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>
---
 libavcodec/mxpegdec.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Michael Niedermayer Sept. 26, 2021, 3:26 p.m. UTC | #1
On Tue, Sep 14, 2021 at 10:58:18PM +0200, Michael Niedermayer wrote:
> 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>
> ---
>  libavcodec/mxpegdec.c | 3 +++
>  1 file changed, 3 insertions(+)

will apply patchset

[...]
diff mbox series

Patch

diff --git a/libavcodec/mxpegdec.c b/libavcodec/mxpegdec.c
index 7c97a9340e1..16e586c1e99 100644
--- a/libavcodec/mxpegdec.c
+++ b/libavcodec/mxpegdec.c
@@ -193,6 +193,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;