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 14:23:07 +0200
commit39dc26f0c104fb601fbe4fb0e66c3aa4341f3cb7 (patch)
tree62c9ada20e0feeed105b35da3a81bdbdeff504c9
parent496267f8e9ec218351e4359e1fde48722d4fc804 (diff)
downloadffmpeg-39dc26f0c104fb601fbe4fb0e66c3aa4341f3cb7.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 abf8711a9c..a33fff7518 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;