[FFmpeg-cvslog] avcodec/jpeg2000dec: Check tile offsets more completely

Michael Niedermayer git at videolan.org
Tue Jun 6 01:06:33 EEST 2017


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Sun May 28 13:52:13 2017 +0200| [0103b3ea924c1447006584b0dc6234bcd0113c00] | committer: Michael Niedermayer

avcodec/jpeg2000dec: Check tile offsets more completely

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 9c1812491f7be2730351969f4abd9b99d300d604)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 51a1eebadc..26d8ea9a3b 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -299,7 +299,10 @@ static int get_siz(Jpeg2000DecoderContext *s)
 
     if (s->tile_offset_x < 0 || s->tile_offset_y < 0 ||
         s->image_offset_x < s->tile_offset_x ||
-        s->image_offset_y < s->tile_offset_y) {
+        s->image_offset_y < s->tile_offset_y ||
+        s->tile_width  + (int64_t)s->tile_offset_x <= s->image_offset_x ||
+        s->tile_height + (int64_t)s->tile_offset_y <= s->image_offset_y
+    ) {
         av_log(s->avctx, AV_LOG_ERROR, "Tile offsets are invalid\n");
         return AVERROR_INVALIDDATA;
     }



More information about the ffmpeg-cvslog mailing list