[FFmpeg-cvslog] lavc/movtextdec.c: Avoid infinite loop on invalid data.

Sasi Inguva git at videolan.org
Wed Sep 28 19:06:24 EEST 2016


ffmpeg | branch: release/3.0 | Sasi Inguva <isasi-at-google.com at ffmpeg.org> | Tue Sep 27 19:23:20 2016 -0700| [82b58841c9d0e9d7d76d59438fe6b2a315e07e38] | committer: Michael Niedermayer

lavc/movtextdec.c: Avoid infinite loop on invalid data.

Signed-off-by: Sasi Inguva <isasi at google.com>
(cherry picked from commit 7e9e1b7070242a79fa6e3acd749d7fe76e39ea7b)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/movtextdec.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
index 8d0e814..28f7b8f 100644
--- a/libavcodec/movtextdec.c
+++ b/libavcodec/movtextdec.c
@@ -477,6 +477,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;



More information about the ffmpeg-cvslog mailing list