From 81bc7bc52e27d592c00fb4ed39a448d18d4d42db Mon Sep 17 00:00:00 2001 From: Wang Yaqiang Date: Thu, 9 Mar 2023 17:29:12 +0800 Subject: [PATCH] avformat/img2dec: fix unable to find svg format when the svg resources start with " Signed-off-by: Marton Balint --- libavformat/img2dec.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c index 5a63d7c81d..c037b6aa88 100644 --- a/libavformat/img2dec.c +++ b/libavformat/img2dec.c @@ -964,8 +964,13 @@ static int svg_probe(const AVProbeData *p) { const uint8_t *b = p->buf; const uint8_t *end = p->buf + p->buf_size; - - if (memcmp(p->buf, "= end - 5) + return 0; + if (!memcmp(b, "buf, "