1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-08 13:22:53 +02:00

avcodec/jpeg2000dec: Check tile offsets more completely

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9c1812491f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2017-05-28 13:52:13 +02:00
parent 7b1d93ce9c
commit 0103b3ea92

View File

@ -299,7 +299,10 @@ static int get_siz(Jpeg2000DecoderContext *s)
if (s->tile_offset_x < 0 || s->tile_offset_y < 0 ||
s->image_offset_x < s->tile_offset_x ||
s->image_offset_y < s->tile_offset_y) {
s->image_offset_y < s->tile_offset_y ||
s->tile_width + (int64_t)s->tile_offset_x <= s->image_offset_x ||
s->tile_height + (int64_t)s->tile_offset_y <= s->image_offset_y
) {
av_log(s->avctx, AV_LOG_ERROR, "Tile offsets are invalid\n");
return AVERROR_INVALIDDATA;
}