1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

j2kdec: fix division by zero, check tile dimensions for validity

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2011-12-24 04:59:25 +01:00
parent 58c41799ab
commit 628c9dcca3

View File

@ -220,6 +220,9 @@ static int get_siz(J2kDecoderContext *s)
s->tile_offset_y = bytestream_get_be32(&s->buf); // YT0Siz
s->ncomponents = bytestream_get_be16(&s->buf); // CSiz
if(s->tile_width<=0 || s->tile_height<=0)
return AVERROR(EINVAL);
if (s->buf_end - s->buf < 2 * s->ncomponents)
return AVERROR(EINVAL);