Unified · Split
| @@ -34,6 +34,7 @@ · 33 unmodified lines | |||
| 34 | #include "internal.h" | 34 | #include "internal.h" |
| 35 | #include "img2.h" | 35 | #include "img2.h" |
| 36 | #include "libavcodec/mjpeg.h" | 36 | #include "libavcodec/mjpeg.h" |
| 37 | #include "subtitles.h" | ||
| 37 | 38 | ||
| 38 | #if HAVE_GLOB | 39 | #if HAVE_GLOB |
| 39 | /* Locally define as 0 (bitwise-OR no-op) any missing glob options that | 40 | /* Locally define as 0 (bitwise-OR no-op) any missing glob options that |
| @@ -875,8 +876,17 @@ static int sunrast_probe(AVProbeData *p) · 835 unmodified lines | |||
| 875 | 876 | ||
| 876 | static int svg_probe(AVProbeData *p) | 877 | static int svg_probe(AVProbeData *p) |
| 877 | { | 878 | { |
| 878 | if (av_match_ext(p->filename, "svg") || av_match_ext(p->filename, "svgz")) | 879 | const uint8_t *b = p->buf; |
| 879 | return AVPROBE_SCORE_EXTENSION + 1; | 880 | const uint8_t *end = p->buf + p->buf_size; |
| 881 | if (memcmp(p->buf, "<?xml", 5)) | ||
| 882 | return 0; | ||
| 883 | while (b < end) { | ||
| 884 | b += ff_subtitles_next_line(b); | ||
| 885 | if (b >= end - 4) | ||
| 886 | return 0; | ||
| 887 | if (!memcmp(b, "<svg", 4)) | ||
| 888 | return AVPROBE_SCORE_EXTENSION + 1; | ||
| 889 | } | ||
| 880 | return 0; | 890 | return 0; |
| 881 | } | 891 | } |
| 882 | 892 | ||