Browse Source

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>
tags/n4.0
Michael Niedermayer 8 years ago
parent
commit
a6cba06205
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      libavformat/img2dec.c

+ 5
- 1
libavformat/img2dec.c View File

@@ -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))


Loading…
Cancel
Save