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:
parent
58c41799ab
commit
628c9dcca3
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user