[FFmpeg-cvslog] avcodec/jpeg2000dec: Handle Psot = 0

Michael Niedermayer git at videolan.org
Tue Jun 9 14:53:32 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Jun  9 14:43:03 2015 +0200| [b6ee1912f98d1db5f31b5d0c182181b79d9233df] | committer: Michael Niedermayer

avcodec/jpeg2000dec: Handle Psot = 0

Fixes Ticket2869

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index ba0d259..c5a3bd2 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -602,6 +602,9 @@ static int get_sot(Jpeg2000DecoderContext *s, int n)
     /* Read TNSot but not used */
     bytestream2_get_byteu(&s->g);               // TNsot
 
+    if (!Psot)
+        Psot = bytestream2_get_bytes_left(&s->g) + n + 2;
+
     if (Psot > bytestream2_get_bytes_left(&s->g) + n + 2) {
         av_log(s->avctx, AV_LOG_ERROR, "Psot %"PRIu32" too big\n", Psot);
         return AVERROR_INVALIDDATA;



More information about the ffmpeg-cvslog mailing list