diff mbox series

[FFmpeg-devel,1/2] avcodec/jpeg2000dec: Check for reduction factor and image offset

Message ID 20230610183109.24802-1-michael@niedermayer.cc
State Accepted
Commit 9b6d191a66a8d9b3064efecc79a9f44fb14d7875
Headers show
Series [FFmpeg-devel,1/2] avcodec/jpeg2000dec: Check for reduction factor and image offset | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer June 10, 2023, 6:31 p.m. UTC
This combination is not working (it writes out of array)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/jpeg2000dec.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Tomas Härdin June 24, 2023, 10:50 a.m. UTC | #1
lör 2023-06-10 klockan 20:31 +0200 skrev Michael Niedermayer:
> This combination is not working (it writes out of array)

Looks OK for now

/Tomas
Michael Niedermayer June 24, 2023, 7:51 p.m. UTC | #2
On Sat, Jun 24, 2023 at 12:50:27PM +0200, Tomas Härdin wrote:
> lör 2023-06-10 klockan 20:31 +0200 skrev Michael Niedermayer:
> > This combination is not working (it writes out of array)
> 
> Looks OK for now

will apply

thx

[...]
diff mbox series

Patch

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) {