Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
74267333
Commit
74267333
authored
Feb 11, 2017
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/mpl2dec: skip BOM when probing
Fixes #5442. Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
a5c1c7a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
mpl2dec.c
libavformat/mpl2dec.c
+8
-0
No files found.
libavformat/mpl2dec.c
View file @
74267333
...
...
@@ -23,6 +23,8 @@
* MPL2 subtitles format demuxer
*/
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
#include "subtitles.h"
...
...
@@ -39,6 +41,9 @@ static int mpl2_probe(AVProbeData *p)
const
unsigned
char
*
ptr
=
p
->
buf
;
const
unsigned
char
*
ptr_end
=
ptr
+
p
->
buf_size
;
if
(
AV_RB24
(
ptr
)
==
0xefbbbf
)
ptr
+=
3
;
for
(
i
=
0
;
i
<
2
;
i
++
)
{
if
(
sscanf
(
ptr
,
"[%"
SCNd64
"][%"
SCNd64
"]%c"
,
&
start
,
&
end
,
&
c
)
!=
3
&&
sscanf
(
ptr
,
"[%"
SCNd64
"][]%c"
,
&
start
,
&
c
)
!=
2
)
...
...
@@ -83,6 +88,9 @@ static int mpl2_read_header(AVFormatContext *s)
st
->
codecpar
->
codec_type
=
AVMEDIA_TYPE_SUBTITLE
;
st
->
codecpar
->
codec_id
=
AV_CODEC_ID_MPL2
;
if
(
avio_rb24
(
s
->
pb
)
!=
0xefbbbf
)
avio_seek
(
s
->
pb
,
-
3
,
SEEK_CUR
);
while
(
!
avio_feof
(
s
->
pb
))
{
char
line
[
4096
];
char
*
p
=
line
;
...
...
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