mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-03-13 09:00:40 +08:00
avcodec/mjpegdec: Check for multiple exif
Fixes: memleak Fixes: 477993717/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AMV_DEC_fuzzer-4515108431921152 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:
@@ -2036,6 +2036,11 @@ static int mjpeg_decode_app(MJpegDecodeContext *s, int start_code)
|
||||
bytestream2_skipu(&s->gB, 2); // skip padding
|
||||
len -= 2;
|
||||
|
||||
if (s->exif_metadata.entries) {
|
||||
av_log(s->avctx, AV_LOG_WARNING, "multiple EXIF\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = av_exif_parse_buffer(s->avctx, s->gB.buffer, len, &s->exif_metadata, AV_EXIF_TIFF_HEADER);
|
||||
if (ret < 0) {
|
||||
av_log(s->avctx, AV_LOG_WARNING, "unable to parse EXIF buffer\n");
|
||||
|
||||
Reference in New Issue
Block a user