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
cd7a2e15
Commit
cd7a2e15
authored
Feb 23, 2017
by
John Stebbins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asfdec: fix reading files larger than 2GB
avio_skip returns file position and overflows int
parent
248dc5c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
asfdec.c
libavformat/asfdec.c
+5
-4
No files found.
libavformat/asfdec.c
View file @
cd7a2e15
...
@@ -976,7 +976,8 @@ static int asf_read_simple_index(AVFormatContext *s, const GUIDParseTable *g)
...
@@ -976,7 +976,8 @@ static int asf_read_simple_index(AVFormatContext *s, const GUIDParseTable *g)
uint64_t
interval
;
// index entry time interval in 100 ns units, usually it's 1s
uint64_t
interval
;
// index entry time interval in 100 ns units, usually it's 1s
uint32_t
pkt_num
,
nb_entries
;
uint32_t
pkt_num
,
nb_entries
;
int32_t
prev_pkt_num
=
-
1
;
int32_t
prev_pkt_num
=
-
1
;
int
i
,
ret
;
int
i
;
int64_t
offset
;
uint64_t
size
=
avio_rl64
(
pb
);
uint64_t
size
=
avio_rl64
(
pb
);
// simple index objects should be ordered by stream number, this loop tries to find
// simple index objects should be ordered by stream number, this loop tries to find
...
@@ -998,10 +999,10 @@ static int asf_read_simple_index(AVFormatContext *s, const GUIDParseTable *g)
...
@@ -998,10 +999,10 @@ static int asf_read_simple_index(AVFormatContext *s, const GUIDParseTable *g)
nb_entries
=
avio_rl32
(
pb
);
nb_entries
=
avio_rl32
(
pb
);
for
(
i
=
0
;
i
<
nb_entries
;
i
++
)
{
for
(
i
=
0
;
i
<
nb_entries
;
i
++
)
{
pkt_num
=
avio_rl32
(
pb
);
pkt_num
=
avio_rl32
(
pb
);
r
et
=
avio_skip
(
pb
,
2
);
offs
et
=
avio_skip
(
pb
,
2
);
if
(
r
et
<
0
)
{
if
(
offs
et
<
0
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Skipping failed in asf_read_simple_index.
\n
"
);
av_log
(
s
,
AV_LOG_ERROR
,
"Skipping failed in asf_read_simple_index.
\n
"
);
return
r
et
;
return
offs
et
;
}
}
if
(
prev_pkt_num
!=
pkt_num
)
{
if
(
prev_pkt_num
!=
pkt_num
)
{
av_add_index_entry
(
st
,
asf
->
first_packet_offset
+
asf
->
packet_size
*
av_add_index_entry
(
st
,
asf
->
first_packet_offset
+
asf
->
packet_size
*
...
...
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