Skip to content

Commit 5086d22

Browse files
committed
avcodec/tiff: Check input space in dng_decode_jpeg()
Fixes: out of array read Fixes: 24034/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5111884337119232 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]> (cherry picked from commit 79e8d17) Signed-off-by: Michael Niedermayer <[email protected]>
1 parent 3c4679c commit 5086d22

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libavcodec/tiff.c

+3
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,9 @@ static int dng_decode_jpeg(AVCodecContext *avctx, AVFrame *frame,
882882
int is_single_comp, is_u16, pixel_size;
883883
int ret;
884884

885+
if (tile_byte_count < 0 || tile_byte_count > bytestream2_get_bytes_left(&s->gb))
886+
return AVERROR_INVALIDDATA;
887+
885888
/* Prepare a packet and send to the MJPEG decoder */
886889
av_init_packet(&jpkt);
887890
jpkt.data = (uint8_t*)s->gb.buffer;

0 commit comments

Comments
 (0)