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
b0c96e06
Commit
b0c96e06
authored
Aug 01, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
idcin: validate header parameters
Avoids using unsupported parameters and signed integer overflows.
parent
f7bf72a4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
idcin.c
libavformat/idcin.c
+19
-0
No files found.
libavformat/idcin.c
View file @
b0c96e06
...
...
@@ -68,6 +68,7 @@
* transmitting them to the video decoder
*/
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
...
...
@@ -153,6 +154,24 @@ static int idcin_read_header(AVFormatContext *s)
bytes_per_sample
=
avio_rl32
(
pb
);
channels
=
avio_rl32
(
pb
);
if
(
av_image_check_size
(
width
,
height
,
0
,
s
)
<
0
)
return
AVERROR_INVALIDDATA
;
if
(
sample_rate
>
0
)
{
if
(
sample_rate
<
14
||
sample_rate
>
INT_MAX
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"invalid sample rate: %u
\n
"
,
sample_rate
);
return
AVERROR_INVALIDDATA
;
}
if
(
bytes_per_sample
<
1
||
bytes_per_sample
>
2
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"invalid bytes per sample: %u
\n
"
,
bytes_per_sample
);
return
AVERROR_INVALIDDATA
;
}
if
(
channels
<
1
||
channels
>
2
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"invalid channels: %u
\n
"
,
channels
);
return
AVERROR_INVALIDDATA
;
}
}
st
=
avformat_new_stream
(
s
,
NULL
);
if
(
!
st
)
return
AVERROR
(
ENOMEM
);
...
...
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