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
e43dd3d2
Commit
e43dd3d2
authored
Sep 14, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qcelp: check output buffer size before decoding
parent
bde25700
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
qcelpdec.c
libavcodec/qcelpdec.c
+8
-2
No files found.
libavcodec/qcelpdec.c
View file @
e43dd3d2
...
@@ -738,11 +738,17 @@ static int qcelp_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
...
@@ -738,11 +738,17 @@ static int qcelp_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
int
buf_size
=
avpkt
->
size
;
int
buf_size
=
avpkt
->
size
;
QCELPContext
*
q
=
avctx
->
priv_data
;
QCELPContext
*
q
=
avctx
->
priv_data
;
float
*
outbuffer
=
data
;
float
*
outbuffer
=
data
;
int
i
;
int
i
,
out_size
;
float
quantized_lspf
[
10
],
lpc
[
10
];
float
quantized_lspf
[
10
],
lpc
[
10
];
float
gain
[
16
];
float
gain
[
16
];
float
*
formant_mem
;
float
*
formant_mem
;
out_size
=
160
*
av_get_bytes_per_sample
(
avctx
->
sample_fmt
);
if
(
*
data_size
<
out_size
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Output buffer is too small
\n
"
);
return
AVERROR
(
EINVAL
);
}
if
((
q
->
bitrate
=
determine_bitrate
(
avctx
,
buf_size
,
&
buf
))
==
I_F_Q
)
if
((
q
->
bitrate
=
determine_bitrate
(
avctx
,
buf_size
,
&
buf
))
==
I_F_Q
)
{
{
warn_insufficient_frame_quality
(
avctx
,
"bitrate cannot be determined."
);
warn_insufficient_frame_quality
(
avctx
,
"bitrate cannot be determined."
);
...
@@ -837,7 +843,7 @@ erasure:
...
@@ -837,7 +843,7 @@ erasure:
memcpy
(
q
->
prev_lspf
,
quantized_lspf
,
sizeof
(
q
->
prev_lspf
));
memcpy
(
q
->
prev_lspf
,
quantized_lspf
,
sizeof
(
q
->
prev_lspf
));
q
->
prev_bitrate
=
q
->
bitrate
;
q
->
prev_bitrate
=
q
->
bitrate
;
*
data_size
=
160
*
sizeof
(
*
outbuffer
)
;
*
data_size
=
out_size
;
return
buf_size
;
return
buf_size
;
}
}
...
...
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