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
61930119
Commit
61930119
authored
Sep 27, 2011
by
Laurent Aimar
Committed by
Michael Niedermayer
Sep 27, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for corrupted extra data in wmavoice decoder.
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
e09ae22a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
wmavoice.c
libavcodec/wmavoice.c
+8
-0
No files found.
libavcodec/wmavoice.c
View file @
61930119
...
...
@@ -401,6 +401,10 @@ static av_cold int wmavoice_decode_init(AVCodecContext *ctx)
s
->
min_pitch_val
=
((
ctx
->
sample_rate
<<
8
)
/
400
+
50
)
>>
8
;
s
->
max_pitch_val
=
((
ctx
->
sample_rate
<<
8
)
*
37
/
2000
+
50
)
>>
8
;
pitch_range
=
s
->
max_pitch_val
-
s
->
min_pitch_val
;
if
(
pitch_range
<=
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid pitch range; broken extradata?
\n
"
);
return
-
1
;
}
s
->
pitch_nbits
=
av_ceil_log2
(
pitch_range
);
s
->
last_pitch_val
=
40
;
s
->
last_acb_type
=
ACB_TYPE_NONE
;
...
...
@@ -422,6 +426,10 @@ static av_cold int wmavoice_decode_init(AVCodecContext *ctx)
s
->
block_conv_table
[
2
]
=
(
pitch_range
*
44
)
>>
6
;
s
->
block_conv_table
[
3
]
=
s
->
max_pitch_val
-
1
;
s
->
block_delta_pitch_hrange
=
(
pitch_range
>>
3
)
&
~
0xF
;
if
(
s
->
block_delta_pitch_hrange
<=
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid delta pitch hrange; broken extradata?
\n
"
);
return
-
1
;
}
s
->
block_delta_pitch_nbits
=
1
+
av_ceil_log2
(
s
->
block_delta_pitch_hrange
);
s
->
block_pitch_range
=
s
->
block_conv_table
[
2
]
+
s
->
block_conv_table
[
3
]
+
1
+
...
...
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