瀏覽代碼

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>
Michael Niedermayer 2 年之前
父節點
當前提交
9b6d191a66
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      libavcodec/jpeg2000dec.c

+ 5 - 0
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) {