Skip to content

Commit 64c6c56

Browse files
committed
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 <[email protected]>
1 parent 9498bc7 commit 64c6c56

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libavcodec/mjpegbdec.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,10 @@ static int mjpegb_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
141141
av_log(avctx, AV_LOG_WARNING, "no picture\n");
142142
return buf_size;
143143
}
144-
145144
av_frame_move_ref(rframe, s->picture_ptr);
146145
s->got_picture = 0;
146+
if (avctx->skip_frame == AVDISCARD_ALL)
147+
return AVERROR(EAGAIN);
147148
*got_frame = 1;
148149

149150
if (!s->lossless && avctx->debug & FF_DEBUG_QP) {

0 commit comments

Comments
 (0)