aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-12-03 00:31:07 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-02-04 17:26:06 +0100
commit401495def62638a205569cac0f7861c7faba4d18 (patch)
treea28a0b89e961cd478766e5344abeb06724a6bbca /libavcodec
parenta5ed6da9bdbe32408aabe1c75e4b55fcaeec1e9b (diff)
downloadffmpeg-401495def62638a205569cac0f7861c7faba4d18.tar.gz
avcodec/mxpegdec: fix SOF counting
Fixes: Timeout (>10sec -> 15ms) Fixes: 27652/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MXPEG_fuzzer-5125920868007936 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mxpegdec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/mxpegdec.c b/libavcodec/mxpegdec.c
index 725e435118..763ce5871d 100644
--- a/libavcodec/mxpegdec.c
+++ b/libavcodec/mxpegdec.c
@@ -245,16 +245,17 @@ static int mxpeg_decode_frame(AVCodecContext *avctx,
"Multiple SOF in a frame\n");
return AVERROR_INVALIDDATA;
}
- s->got_sof_data = 0;
ret = ff_mjpeg_decode_sof(jpg);
if (ret < 0) {
av_log(avctx, AV_LOG_ERROR,
"SOF data decode error\n");
+ s->got_sof_data = 0;
return ret;
}
if (jpg->interlaced) {
av_log(avctx, AV_LOG_ERROR,
"Interlaced mode not supported in MxPEG\n");
+ s->got_sof_data = 0;
return AVERROR(EINVAL);
}
s->got_sof_data ++;