[FFmpeg-cvslog] avcodec/jpeg2000dec: Check for reduction factor and image offset

Michael Niedermayer git at videolan.org
Thu Oct 19 14:31:46 EEST 2023


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Sat Jun 10 01:09:52 2023 +0200| [6503cf3cf5cf435575ee9c27dae8545f6d0e8de5] | committer: Michael Niedermayer

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 at haerdin.se>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 9b6d191a66a8d9b3064efecc79a9f44fb14d7875)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6503cf3cf5cf435575ee9c27dae8545f6d0e8de5
---

 libavcodec/jpeg2000dec.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 23b1d3cd3e..8c93add6e5 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -308,6 +308,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) {



More information about the ffmpeg-cvslog mailing list