Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
a20f64be
Commit
a20f64be
authored
Oct 02, 2017
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/img2dec: Auto-detect svg images.
parent
cc5b7601
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
img2dec.c
libavformat/img2dec.c
+12
-2
No files found.
libavformat/img2dec.c
View file @
a20f64be
...
...
@@ -34,6 +34,7 @@
#include "internal.h"
#include "img2.h"
#include "libavcodec/mjpeg.h"
#include "subtitles.h"
#if HAVE_GLOB
/* Locally define as 0 (bitwise-OR no-op) any missing glob options that
...
...
@@ -875,8 +876,17 @@ static int sunrast_probe(AVProbeData *p)
static
int
svg_probe
(
AVProbeData
*
p
)
{
if
(
av_match_ext
(
p
->
filename
,
"svg"
)
||
av_match_ext
(
p
->
filename
,
"svgz"
))
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
);
if
(
b
>=
end
-
4
)
return
0
;
if
(
!
memcmp
(
b
,
"<svg"
,
4
))
return
AVPROBE_SCORE_EXTENSION
+
1
;
}
return
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment