Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-03-10 03:40:36 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2018-03-10 04:44:45 +0300
commita6cba062051f345e8ebfdff34aba071ed73d923f (patch)
tree01e84ff4736a9acfbad7604cb9cd69c1bcf7d1ad /libavformat/img2dec.c
parentf655ddfb47e8484b205b14c7f871c643ad24d701 (diff)
avformat/img2dec: fix infinite loop
Fixes: kira-poc Found-by: Kira <kira_cxy@foxmail.com> Change suggested by Kira Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/img2dec.c')
-rw-r--r--libavformat/img2dec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index 62db0d92cf..f3f52c83b3 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -878,10 +878,14 @@ static int svg_probe(AVProbeData *p)
{
const uint8_t *b = p->buf;
const uint8_t *end = p->buf + p->buf_size;
+
if (memcmp(p->buf, "<?xml", 5))
return 0;
while (b < end) {
- b += ff_subtitles_next_line(b);
+ int inc = ff_subtitles_next_line(b);
+ if (!inc)
+ break;
+ b += inc;
if (b >= end - 4)
return 0;
if (!memcmp(b, "<svg", 4))