Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
a43283b6
Commit
a43283b6
authored
12 years ago
by
Anton Khirnov
Browse files
Options
Downloads
Patches
Plain Diff
wavdec: check size before reading the data, not after.
parent
79922d72
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavformat/wavdec.c
+2
-3
2 additions, 3 deletions
libavformat/wavdec.c
with
2 additions
and
3 deletions
libavformat/wavdec.c
+
2
−
3
View file @
a43283b6
...
@@ -204,7 +204,7 @@ static int wav_read_header(AVFormatContext *s)
...
@@ -204,7 +204,7 @@ static int wav_read_header(AVFormatContext *s)
int64_t
size
,
av_uninit
(
data_size
);
int64_t
size
,
av_uninit
(
data_size
);
int64_t
sample_count
=
0
;
int64_t
sample_count
=
0
;
int
rf64
;
int
rf64
;
uint32_t
tag
,
list_type
;
uint32_t
tag
;
AVIOContext
*
pb
=
s
->
pb
;
AVIOContext
*
pb
=
s
->
pb
;
AVStream
*
st
=
NULL
;
AVStream
*
st
=
NULL
;
WAVDemuxContext
*
wav
=
s
->
priv_data
;
WAVDemuxContext
*
wav
=
s
->
priv_data
;
...
@@ -287,12 +287,11 @@ static int wav_read_header(AVFormatContext *s)
...
@@ -287,12 +287,11 @@ static int wav_read_header(AVFormatContext *s)
return
ret
;
return
ret
;
break
;
break
;
case
MKTAG
(
'L'
,
'I'
,
'S'
,
'T'
):
case
MKTAG
(
'L'
,
'I'
,
'S'
,
'T'
):
list_type
=
avio_rl32
(
pb
);
if
(
size
<
4
)
{
if
(
size
<
4
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"too short LIST"
);
av_log
(
s
,
AV_LOG_ERROR
,
"too short LIST"
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
switch
(
list_type
)
{
switch
(
avio_rl32
(
pb
)
)
{
case
MKTAG
(
'I'
,
'N'
,
'F'
,
'O'
):
case
MKTAG
(
'I'
,
'N'
,
'F'
,
'O'
):
if
((
ret
=
ff_read_riff_info
(
s
,
size
-
4
))
<
0
)
if
((
ret
=
ff_read_riff_info
(
s
,
size
-
4
))
<
0
)
return
ret
;
return
ret
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment