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
5674d4b0
Commit
5674d4b0
authored
Sep 14, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpc8: check output buffer size before decoding
parent
8290d1f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
mpc8.c
libavcodec/mpc8.c
+8
-2
No files found.
libavcodec/mpc8.c
View file @
5674d4b0
...
...
@@ -241,10 +241,16 @@ static int mpc8_decode_frame(AVCodecContext * avctx,
GetBitContext
gb2
,
*
gb
=
&
gb2
;
int
i
,
j
,
k
,
ch
,
cnt
,
res
,
t
;
Band
*
bands
=
c
->
bands
;
int
off
;
int
off
,
out_size
;
int
maxband
,
keyframe
;
int
last
[
2
];
out_size
=
MPC_FRAME_SIZE
*
2
*
avctx
->
channels
;
if
(
*
data_size
<
out_size
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Output buffer is too small
\n
"
);
return
AVERROR
(
EINVAL
);
}
keyframe
=
c
->
cur_frame
==
0
;
if
(
keyframe
){
...
...
@@ -400,7 +406,7 @@ static int mpc8_decode_frame(AVCodecContext * avctx,
c
->
last_bits_used
=
get_bits_count
(
gb
);
if
(
c
->
cur_frame
>=
c
->
frames
)
c
->
cur_frame
=
0
;
*
data_size
=
MPC_FRAME_SIZE
*
2
*
avctx
->
channels
;
*
data_size
=
out_size
;
return
c
->
cur_frame
?
c
->
last_bits_used
>>
3
:
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