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
37b67f1b
Commit
37b67f1b
authored
Sep 21, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mlpdec: only calculate output size once
parent
caa84585
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
mlpdec.c
libavcodec/mlpdec.c
+7
-3
No files found.
libavcodec/mlpdec.c
View file @
37b67f1b
...
...
@@ -906,6 +906,7 @@ static int output_data_internal(MLPDecodeContext *m, unsigned int substr,
{
SubStream
*
s
=
&
m
->
substream
[
substr
];
unsigned
int
i
,
out_ch
=
0
;
int
out_size
;
int32_t
*
data_32
=
(
int32_t
*
)
data
;
int16_t
*
data_16
=
(
int16_t
*
)
data
;
...
...
@@ -914,8 +915,11 @@ static int output_data_internal(MLPDecodeContext *m, unsigned int substr,
return
AVERROR_INVALIDDATA
;
}
if
(
*
data_size
<
m
->
avctx
->
channels
*
s
->
blockpos
*
(
is32
?
4
:
2
))
return
-
1
;
out_size
=
s
->
blockpos
*
m
->
avctx
->
channels
*
av_get_bytes_per_sample
(
m
->
avctx
->
sample_fmt
);
if
(
*
data_size
<
out_size
)
return
AVERROR
(
EINVAL
);
for
(
i
=
0
;
i
<
s
->
blockpos
;
i
++
)
{
for
(
out_ch
=
0
;
out_ch
<=
s
->
max_matrix_channel
;
out_ch
++
)
{
...
...
@@ -928,7 +932,7 @@ static int output_data_internal(MLPDecodeContext *m, unsigned int substr,
}
}
*
data_size
=
i
*
out_ch
*
(
is32
?
4
:
2
)
;
*
data_size
=
out_size
;
return
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