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
fac6b7f9
Commit
fac6b7f9
authored
Sep 14, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nellymoserdec: allocate float_buf only when decoding to int16
parent
32b48446
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
nellymoserdec.c
libavcodec/nellymoserdec.c
+7
-1
No files found.
libavcodec/nellymoserdec.c
View file @
fac6b7f9
...
...
@@ -47,7 +47,7 @@
typedef
struct
NellyMoserDecodeContext
{
AVCodecContext
*
avctx
;
DECLARE_ALIGNED
(
32
,
float
,
float_buf
)[
NELLY_SAMPLES
]
;
float
*
float_buf
;
float
state
[
NELLY_BUF_LEN
];
AVLFG
random_state
;
GetBitContext
gb
;
...
...
@@ -145,6 +145,11 @@ static av_cold int decode_init(AVCodecContext * avctx) {
s
->
scale_bias
=
1
.
0
/
(
1
*
8
);
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_S16
;
ff_fmt_convert_init
(
&
s
->
fmt_conv
,
avctx
);
s
->
float_buf
=
av_mallocz
(
NELLY_SAMPLES
*
sizeof
(
*
s
->
float_buf
));
if
(
!
s
->
float_buf
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"error allocating float buffer
\n
"
);
return
AVERROR
(
ENOMEM
);
}
}
/* Generate overlap window */
...
...
@@ -208,6 +213,7 @@ static int decode_tag(AVCodecContext * avctx,
static
av_cold
int
decode_end
(
AVCodecContext
*
avctx
)
{
NellyMoserDecodeContext
*
s
=
avctx
->
priv_data
;
av_freep
(
&
s
->
float_buf
);
ff_mdct_end
(
&
s
->
imdct_ctx
);
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