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
1360f07e
Commit
1360f07e
authored
Jan 18, 2011
by
Daniel Kang
Committed by
Justin Ruggles
Jan 18, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add check for changing number of channels in DCA.
Fixes issue 2505.
parent
59e2118e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
dca.c
libavcodec/dca.c
+9
-0
No files found.
libavcodec/dca.c
View file @
1360f07e
...
@@ -273,6 +273,7 @@ typedef struct {
...
@@ -273,6 +273,7 @@ typedef struct {
/* Primary audio coding header */
/* Primary audio coding header */
int
subframes
;
///< number of subframes
int
subframes
;
///< number of subframes
int
is_channels_set
;
///< check for if the channel number is already set
int
total_channels
;
///< number of channels including extensions
int
total_channels
;
///< number of channels including extensions
int
prim_channels
;
///< number of primary audio channels
int
prim_channels
;
///< number of primary audio channels
int
subband_activity
[
DCA_PRIM_CHANNELS_MAX
];
///< subband activity count
int
subband_activity
[
DCA_PRIM_CHANNELS_MAX
];
///< subband activity count
...
@@ -1774,7 +1775,15 @@ static int dca_decode_frame(AVCodecContext * avctx,
...
@@ -1774,7 +1775,15 @@ static int dca_decode_frame(AVCodecContext * avctx,
unset. Ideally during the first probe for channels the crc should be checked
unset. Ideally during the first probe for channels the crc should be checked
and only set avctx->channels when the crc is ok. Right now the decoder could
and only set avctx->channels when the crc is ok. Right now the decoder could
set the channels based on a broken first frame.*/
set the channels based on a broken first frame.*/
if
(
s
->
is_channels_set
==
0
)
{
s
->
is_channels_set
=
1
;
avctx
->
channels
=
channels
;
avctx
->
channels
=
channels
;
}
if
(
avctx
->
channels
!=
channels
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"DCA decoder does not support number of "
"channels changing in stream. Skipping frame.
\n
"
);
return
-
1
;
}
if
(
*
data_size
<
(
s
->
sample_blocks
/
8
)
*
256
*
sizeof
(
int16_t
)
*
channels
)
if
(
*
data_size
<
(
s
->
sample_blocks
/
8
)
*
256
*
sizeof
(
int16_t
)
*
channels
)
return
-
1
;
return
-
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