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
f080a7bd
Commit
f080a7bd
authored
Oct 04, 2008
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factorize stream id parsing.
Originally committed as revision 15556 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
6bc03a69
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
+11
-12
avidec.c
libavformat/avidec.c
+11
-12
No files found.
libavformat/avidec.c
View file @
f080a7bd
...
...
@@ -614,6 +614,15 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
return
0
;
}
static
int
get_stream_idx
(
int
*
d
){
if
(
d
[
0
]
>=
'0'
&&
d
[
0
]
<=
'9'
&&
d
[
1
]
>=
'0'
&&
d
[
1
]
<=
'9'
){
return
(
d
[
0
]
-
'0'
)
*
10
+
(
d
[
1
]
-
'0'
);
}
else
{
return
100
;
//invalid stream ID
}
}
static
int
avi_read_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
{
AVIContext
*
avi
=
s
->
priv_data
;
...
...
@@ -756,12 +765,7 @@ resync:
size
=
d
[
4
]
+
(
d
[
5
]
<<
8
)
+
(
d
[
6
]
<<
16
)
+
(
d
[
7
]
<<
24
);
if
(
d
[
2
]
>=
'0'
&&
d
[
2
]
<=
'9'
&&
d
[
3
]
>=
'0'
&&
d
[
3
]
<=
'9'
){
n
=
(
d
[
2
]
-
'0'
)
*
10
+
(
d
[
3
]
-
'0'
);
}
else
{
n
=
100
;
//invalid stream id
}
n
=
get_stream_idx
(
d
+
2
);
//av_log(NULL, AV_LOG_DEBUG, "%X %X %X %X %X %X %X %X %"PRId64" %d %d\n", d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], i, size, n);
if
(
i
+
size
>
avi
->
fsize
||
d
[
0
]
<
0
)
continue
;
...
...
@@ -776,12 +780,7 @@ resync:
goto
resync
;
}
if
(
d
[
0
]
>=
'0'
&&
d
[
0
]
<=
'9'
&&
d
[
1
]
>=
'0'
&&
d
[
1
]
<=
'9'
){
n
=
(
d
[
0
]
-
'0'
)
*
10
+
(
d
[
1
]
-
'0'
);
}
else
{
n
=
100
;
//invalid stream ID
}
n
=
get_stream_idx
(
d
);
//parse ##dc/##wb
if
(
n
<
s
->
nb_streams
){
...
...
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