aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSasi Inguva <isasi-at-google.com@ffmpeg.org>2016-09-27 19:23:20 -0700
committerMichael Niedermayer <michael@niedermayer.cc>2016-09-28 11:12:20 +0200
commitca216c71c77db13171717a69307a56c35f3246be (patch)
treeec49e7631aef580777bd9f914b050e45ecc936c7
parentab737ab31d4f126ed5a13a6a0498824141925108 (diff)
downloadffmpeg-ca216c71c77db13171717a69307a56c35f3246be.tar.gz
lavc/movtextdec.c: Avoid infinite loop on invalid data.
Signed-off-by: Sasi Inguva <isasi@google.com> (cherry picked from commit 7e9e1b7070242a79fa6e3acd749d7fe76e39ea7b) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/movtextdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
index 257d5986f5..e7c3d490fd 100644
--- a/libavcodec/movtextdec.c
+++ b/libavcodec/movtextdec.c
@@ -476,6 +476,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;