lavc/movtextdec.c: Avoid infinite loop on invalid data.
authorSasi Inguva <isasi-at-google.com@ffmpeg.org>
Wed, 28 Sep 2016 02:23:20 +0000 (19:23 -0700)
committerPhilip Langdale <philipl@overt.org>
Wed, 28 Sep 2016 02:49:02 +0000 (19:49 -0700)
Signed-off-by: Sasi Inguva <isasi@google.com>
libavcodec/movtextdec.c

index abf8711..a33fff7 100644 (file)
@@ -471,6 +471,10 @@ static int mov_text_decode_frame(AVCodecContext *avctx,
             tsmb_type = AV_RB32(tsmb);
             tsmb += 4;
 
+            if (tsmb_size == 0) {
+              return AVERROR_INVALIDDATA;
+            }
+
             if (tsmb_size == 1) {
                 if (m->tracksize + 16 > avpkt->size)
                     break;