mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-23 19:49:56 +00:00
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>
This commit is contained in:
parent
ad29f9e47c
commit
b9ea493afe
@ -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) */
|
/* 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 */
|
/* See dng_blit for explanation */
|
||||||
if (s->avctx_mjpeg->width == w * 2 &&
|
if (s->avctx_mjpeg->width == w * 2 &&
|
||||||
s->avctx_mjpeg->height == h / 2 &&
|
s->avctx_mjpeg->height == h / 2 &&
|
||||||
|
Loading…
Reference in New Issue
Block a user