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

Sasi Inguva git at videolan.org
Wed Sep 28 15:50:15 EEST 2016


ffmpeg | branch: release/3.1 | Sasi Inguva <isasi-at-google.com at ffmpeg.org> | Tue Sep 27 19:23:20 2016 -0700| [39dc26f0c104fb601fbe4fb0e66c3aa4341f3cb7] | 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=39dc26f0c104fb601fbe4fb0e66c3aa4341f3cb7
---

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

diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
index abf8711..a33fff7 100644
--- a/libavcodec/movtextdec.c
+++ b/libavcodec/movtextdec.c
@@ -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;



More information about the ffmpeg-cvslog mailing list