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
0ab36879
Commit
0ab36879
authored
Feb 10, 2012
by
Alex Converse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dv: Fix small overread in audio frequency table.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
parent
b758cf73
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
dv.c
libavformat/dv.c
+9
-0
No files found.
libavformat/dv.c
View file @
0ab36879
...
@@ -121,6 +121,9 @@ static int dv_extract_audio(uint8_t* frame, uint8_t* ppcm[4],
...
@@ -121,6 +121,9 @@ static int dv_extract_audio(uint8_t* frame, uint8_t* ppcm[4],
if
(
quant
>
1
)
if
(
quant
>
1
)
return
-
1
;
/* unsupported quantization */
return
-
1
;
/* unsupported quantization */
if
(
freq
>=
FF_ARRAY_ELEMS
(
dv_audio_frequency
))
return
AVERROR_INVALIDDATA
;
size
=
(
sys
->
audio_min_samples
[
freq
]
+
smpls
)
*
4
;
/* 2ch, 2bytes */
size
=
(
sys
->
audio_min_samples
[
freq
]
+
smpls
)
*
4
;
/* 2ch, 2bytes */
half_ch
=
sys
->
difseg_size
/
2
;
half_ch
=
sys
->
difseg_size
/
2
;
...
@@ -203,6 +206,12 @@ static int dv_extract_audio_info(DVDemuxContext* c, uint8_t* frame)
...
@@ -203,6 +206,12 @@ static int dv_extract_audio_info(DVDemuxContext* c, uint8_t* frame)
stype
=
(
as_pack
[
3
]
&
0x1f
);
/* 0 - 2CH, 2 - 4CH, 3 - 8CH */
stype
=
(
as_pack
[
3
]
&
0x1f
);
/* 0 - 2CH, 2 - 4CH, 3 - 8CH */
quant
=
as_pack
[
4
]
&
0x07
;
/* 0 - 16bit linear, 1 - 12bit nonlinear */
quant
=
as_pack
[
4
]
&
0x07
;
/* 0 - 16bit linear, 1 - 12bit nonlinear */
if
(
freq
>=
FF_ARRAY_ELEMS
(
dv_audio_frequency
))
{
av_log
(
c
->
fctx
,
AV_LOG_ERROR
,
"Unrecognized audio sample rate index (%d)
\n
"
,
freq
);
return
0
;
}
if
(
stype
>
3
)
{
if
(
stype
>
3
)
{
av_log
(
c
->
fctx
,
AV_LOG_ERROR
,
"stype %d is invalid
\n
"
,
stype
);
av_log
(
c
->
fctx
,
AV_LOG_ERROR
,
"stype %d is invalid
\n
"
,
stype
);
c
->
ach
=
0
;
c
->
ach
=
0
;
...
...
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