[FFmpeg-cvslog] avcodec/mjpegbdec: Check for AVDISCARD_ALL

Michael Niedermayer git at videolan.org
Fri Dec 23 01:46:02 EET 2022


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Nov 12 20:29:14 2022 +0100| [64c6c568908ee9d7f9a5d75686b6d4ce3334222c] | committer: Michael Niedermayer

avcodec/mjpegbdec: Check for AVDISCARD_ALL

Fixes: Assertion failure
Fixes: 51825/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEGB_fuzzer-6393802688692224

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=64c6c568908ee9d7f9a5d75686b6d4ce3334222c
---

 libavcodec/mjpegbdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/mjpegbdec.c b/libavcodec/mjpegbdec.c
index 98c64b44ca..a82a95d70a 100644
--- a/libavcodec/mjpegbdec.c
+++ b/libavcodec/mjpegbdec.c
@@ -141,9 +141,10 @@ read_header:
         av_log(avctx, AV_LOG_WARNING, "no picture\n");
         return buf_size;
     }
-
     av_frame_move_ref(rframe, s->picture_ptr);
     s->got_picture = 0;
+    if (avctx->skip_frame == AVDISCARD_ALL)
+        return AVERROR(EAGAIN);
     *got_frame = 1;
 
     if (!s->lossless && avctx->debug & FF_DEBUG_QP) {



More information about the ffmpeg-cvslog mailing list