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@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2022-11-12 20:29:14 +01:00
parent 9498bc7c32
commit 64c6c56890
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -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) {