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
d94e29ca
Commit
d94e29ca
authored
Sep 27, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcmdec: move number of channels check to pcm_decode_init()
parent
83efd765
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
pcm.c
libavcodec/pcm.c
+5
-5
No files found.
libavcodec/pcm.c
View file @
d94e29ca
...
...
@@ -213,6 +213,11 @@ static av_cold int pcm_decode_init(AVCodecContext * avctx)
PCMDecode
*
s
=
avctx
->
priv_data
;
int
i
;
if
(
avctx
->
channels
<=
0
||
avctx
->
channels
>
MAX_CHANNELS
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"PCM channels out of bounds
\n
"
);
return
AVERROR
(
EINVAL
);
}
switch
(
avctx
->
codec
->
id
)
{
case
CODEC_ID_PCM_ALAW
:
for
(
i
=
0
;
i
<
256
;
i
++
)
...
...
@@ -266,11 +271,6 @@ static int pcm_decode_frame(AVCodecContext *avctx,
samples
=
data
;
src
=
buf
;
if
(
avctx
->
channels
<=
0
||
avctx
->
channels
>
MAX_CHANNELS
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"PCM channels out of bounds
\n
"
);
return
-
1
;
}
sample_size
=
av_get_bits_per_sample
(
avctx
->
codec_id
)
/
8
;
/* av_get_bits_per_sample returns 0 for CODEC_ID_PCM_DVD */
...
...
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