avcodec/jpeg2000dec: Check for reduction factor and image offset

This combination is not working (it writes out of array)

Reviewed-by: Tomas Härdin <git@haerdin.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2023-06-10 01:09:52 +02:00
parent 6ff95758e6
commit 9b6d191a66
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 5 additions and 0 deletions

View File

@ -238,6 +238,11 @@ static int get_siz(Jpeg2000DecoderContext *s)
return AVERROR_INVALIDDATA;
}
if (s->reduction_factor && (s->image_offset_x || s->image_offset_y) ){
av_log(s->avctx, AV_LOG_ERROR, "reduction factor with image offsets is not fully implemented");
return AVERROR_PATCHWELCOME;
}
s->ncomponents = ncomponents;
if (s->tile_width <= 0 || s->tile_height <= 0) {