diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2023-06-10 01:09:52 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2023-06-27 22:36:44 +0200 |
commit | 9b6d191a66a8d9b3064efecc79a9f44fb14d7875 (patch) | |
tree | 539be898fe5ed62798e9a2578489235ab1291fcd | |
parent | 6ff95758e6bf47004f69c56d7547a971c4782b21 (diff) | |
download | ffmpeg-9b6d191a66a8d9b3064efecc79a9f44fb14d7875.tar.gz |
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>
-rw-r--r-- | libavcodec/jpeg2000dec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index 0e95cca64e..d6f2a5938e 100644 --- a/libavcodec/jpeg2000dec.c +++ b/libavcodec/jpeg2000dec.c @@ -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) { |