Commit a6cba062 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/img2dec: fix infinite loop

Fixes: kira-poc
Found-by: 's avatarKira <kira_cxy@foxmail.com>
Change suggested by Kira
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent f655ddfb
......@@ -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))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment