You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
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>
This commit is contained in:
@@ -878,10 +878,14 @@ static int svg_probe(AVProbeData *p)
|
|||||||
{
|
{
|
||||||
const uint8_t *b = p->buf;
|
const uint8_t *b = p->buf;
|
||||||
const uint8_t *end = p->buf + p->buf_size;
|
const uint8_t *end = p->buf + p->buf_size;
|
||||||
|
|
||||||
if (memcmp(p->buf, "<?xml", 5))
|
if (memcmp(p->buf, "<?xml", 5))
|
||||||
return 0;
|
return 0;
|
||||||
while (b < end) {
|
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)
|
if (b >= end - 4)
|
||||||
return 0;
|
return 0;
|
||||||
if (!memcmp(b, "<svg", 4))
|
if (!memcmp(b, "<svg", 4))
|
||||||
|
Reference in New Issue
Block a user