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
c0a49077
Commit
c0a49077
authored
Sep 07, 2015
by
Alexandra Hájková
Committed by
Luca Barbato
Sep 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asfdec: add more checks for size left in asf packet buffer
Signed-off-by:
Luca Barbato
<
lu_zero@gentoo.org
>
parent
1b2412f5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
asfdec.c
libavformat/asfdec.c
+4
-2
No files found.
libavformat/asfdec.c
View file @
c0a49077
...
...
@@ -1141,7 +1141,7 @@ static int asf_read_replicated_data(AVFormatContext *s, ASFPacket *asf_pkt)
if
(
!
asf_pkt
->
data_size
)
{
asf_pkt
->
data_size
=
asf_pkt
->
size_left
=
avio_rl32
(
pb
);
// read media object size
if
(
asf_pkt
->
data_size
<=
0
)
return
AVERROR_
EOF
;
return
AVERROR_
INVALIDDATA
;
if
((
ret
=
av_new_packet
(
&
asf_pkt
->
avpkt
,
asf_pkt
->
data_size
))
<
0
)
return
ret
;
}
else
...
...
@@ -1190,6 +1190,8 @@ static int asf_read_multiple_payload(AVFormatContext *s, AVPacket *pkt,
skip
=
pay_len
-
asf_pkt
->
size_left
;
pay_len
=
asf_pkt
->
size_left
;
}
if
(
asf_pkt
->
size_left
<=
0
)
return
AVERROR_INVALIDDATA
;
if
((
ret
=
avio_read
(
pb
,
p
,
pay_len
))
<
0
)
return
ret
;
if
(
s
->
key
&&
s
->
keylen
==
20
)
...
...
@@ -1237,7 +1239,7 @@ static int asf_read_single_payload(AVFormatContext *s, AVPacket *pkt,
return
AVERROR_INVALIDDATA
;
}
p
=
asf_pkt
->
avpkt
.
data
+
asf_pkt
->
data_size
-
asf_pkt
->
size_left
;
if
(
size
>
asf_pkt
->
size_left
)
if
(
size
>
asf_pkt
->
size_left
||
asf_pkt
->
size_left
<=
0
)
return
AVERROR_INVALIDDATA
;
if
(
asf_pkt
->
size_left
>
size
)
asf_pkt
->
size_left
-=
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