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
ff6a5fc1
Commit
ff6a5fc1
authored
Sep 02, 2010
by
Reimar Döffinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimize/simplify ebml_read_num.
Originally committed as revision 25026 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
69a9c80b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
matroskadec.c
libavformat/matroskadec.c
+4
-7
No files found.
libavformat/matroskadec.c
View file @
ff6a5fc1
...
...
@@ -538,8 +538,8 @@ static int ebml_level_end(MatroskaDemuxContext *matroska)
static
int
ebml_read_num
(
MatroskaDemuxContext
*
matroska
,
ByteIOContext
*
pb
,
int
max_size
,
uint64_t
*
number
)
{
int
len_mask
=
0x80
,
read
=
1
,
n
=
1
;
int64_t
total
=
0
;
int
read
=
1
,
n
=
1
;
u
int64_t
total
=
0
;
/* The first byte tells us the length in bytes - get_byte() can normally
* return 0, but since that's not a valid first ebmlID byte, we can
...
...
@@ -556,10 +556,7 @@ static int ebml_read_num(MatroskaDemuxContext *matroska, ByteIOContext *pb,
}
/* get the length of the EBML number */
while
(
read
<=
max_size
&&
!
(
total
&
len_mask
))
{
read
++
;
len_mask
>>=
1
;
}
read
=
8
-
ff_log2_tab
[
total
];
if
(
read
>
max_size
)
{
int64_t
pos
=
url_ftell
(
pb
)
-
1
;
av_log
(
matroska
->
ctx
,
AV_LOG_ERROR
,
...
...
@@ -569,7 +566,7 @@ static int ebml_read_num(MatroskaDemuxContext *matroska, ByteIOContext *pb,
}
/* read out length */
total
&=
~
len_mask
;
total
^=
1
<<
ff_log2_tab
[
total
]
;
while
(
n
++
<
read
)
total
=
(
total
<<
8
)
|
get_byte
(
pb
);
...
...
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