Skip to content
Snippets Groups Projects
Commit 5086d226 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

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: default avatarMichael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 79e8d170)
Signed-off-by: default avatarMichael Niedermayer <michael@niedermayer.cc>
parent 3c4679c4
No related branches found
No related tags found
No related merge requests found
......@@ -882,6 +882,9 @@ static int dng_decode_jpeg(AVCodecContext *avctx, AVFrame *frame,
int is_single_comp, is_u16, pixel_size;
int ret;
if (tile_byte_count < 0 || tile_byte_count > bytestream2_get_bytes_left(&s->gb))
return AVERROR_INVALIDDATA;
/* Prepare a packet and send to the MJPEG decoder */
av_init_packet(&jpkt);
jpkt.data = (uint8_t*)s->gb.buffer;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment