Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-08-20 02:05:35 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2021-02-02 16:18:20 +0300
commit8362cc45ef3c4aec74cfc845c07824e2ea7ffbf1 (patch)
tree59ccceb4a05e6a4b1baed987a190250869aa3874 /libavcodec
parent4b8bb69f55fd41987306fda0895d47acd745f77f (diff)
avcodec/tiff: Check jpeg context against jpeg frame parameters
Fixes: out of array access Fixes: 24825/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6326925027704832 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit b9ea493afe8576efe3de60f8c6723f9f155de0d8) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/tiff.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 86f8487086..8a42e677ce 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -919,6 +919,11 @@ static int dng_decode_jpeg(AVCodecContext *avctx, AVFrame *frame,
/* Copy the outputted tile's pixels from 'jpgframe' to 'frame' (final buffer) */
+ if (s->jpgframe->width != s->avctx_mjpeg->width ||
+ s->jpgframe->height != s->avctx_mjpeg->height ||
+ s->jpgframe->format != s->avctx_mjpeg->pix_fmt)
+ return AVERROR_INVALIDDATA;
+
/* See dng_blit for explanation */
if (s->avctx_mjpeg->width == w * 2 &&
s->avctx_mjpeg->height == h / 2 &&