mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-23 04:24:35 +02:00
j2kdec: check colorspace ncomponents
This prevents out of array read. Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
dd2086140c
commit
29e9f83192
@ -217,6 +217,10 @@ static int get_siz(J2kDecoderContext *s)
|
||||
s->tile_offset_y = bytestream2_get_be32u(&s->g); // YT0Siz
|
||||
s->ncomponents = bytestream2_get_be16u(&s->g); // CSiz
|
||||
|
||||
if(s->ncomponents <= 0 || s->ncomponents > 4) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "unsupported/invalid ncomponents: %d\n", s->ncomponents);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
if(s->tile_width<=0 || s->tile_height<=0)
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user