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
8a57ca5c
Commit
8a57ca5c
authored
Aug 08, 2012
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aasc: fix out of array write
Closes #1619. Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
4ec03d13
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
aasc.c
libavcodec/aasc.c
+5
-4
No files found.
libavcodec/aasc.c
View file @
8a57ca5c
...
...
@@ -66,7 +66,7 @@ static int aasc_decode_frame(AVCodecContext *avctx,
const
uint8_t
*
buf
=
avpkt
->
data
;
int
buf_size
=
avpkt
->
size
;
AascContext
*
s
=
avctx
->
priv_data
;
int
compr
,
i
,
stride
;
int
compr
,
i
,
stride
,
psize
;
s
->
frame
.
reference
=
3
;
s
->
frame
.
buffer_hints
=
FF_BUFFER_HINTS_VALID
|
FF_BUFFER_HINTS_PRESERVE
|
FF_BUFFER_HINTS_REUSABLE
;
...
...
@@ -78,6 +78,7 @@ static int aasc_decode_frame(AVCodecContext *avctx,
compr
=
AV_RL32
(
buf
);
buf
+=
4
;
buf_size
-=
4
;
psize
=
avctx
->
bits_per_coded_sample
/
8
;
switch
(
avctx
->
codec_tag
)
{
case
MKTAG
(
'A'
,
'A'
,
'S'
,
'4'
):
bytestream2_init
(
&
s
->
gb
,
buf
-
4
,
buf_size
+
4
);
...
...
@@ -86,13 +87,13 @@ static int aasc_decode_frame(AVCodecContext *avctx,
case
MKTAG
(
'A'
,
'A'
,
'S'
,
'C'
):
switch
(
compr
){
case
0
:
stride
=
(
avctx
->
width
*
3
+
3
)
&
~
3
;
stride
=
(
avctx
->
width
*
psize
+
psize
)
&
~
psize
;
for
(
i
=
avctx
->
height
-
1
;
i
>=
0
;
i
--
){
if
(
avctx
->
width
*
3
>
buf_size
){
if
(
avctx
->
width
*
psize
>
buf_size
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"Next line is beyond buffer bounds
\n
"
);
break
;
}
memcpy
(
s
->
frame
.
data
[
0
]
+
i
*
s
->
frame
.
linesize
[
0
],
buf
,
avctx
->
width
*
3
);
memcpy
(
s
->
frame
.
data
[
0
]
+
i
*
s
->
frame
.
linesize
[
0
],
buf
,
avctx
->
width
*
psize
);
buf
+=
stride
;
buf_size
-=
stride
;
}
...
...
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