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
8df8a87e
Commit
8df8a87e
authored
Sep 30, 2011
by
Laurent Aimar
Committed by
Janne Grunau
Oct 10, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eacmv: fix potential pointer arithmetic overflows
Signed-off-by:
Janne Grunau
<
janne-libav@jannau.net
>
parent
c7f89064
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
eacmv.c
libavcodec/eacmv.c
+4
-4
No files found.
libavcodec/eacmv.c
View file @
8df8a87e
...
...
@@ -52,7 +52,7 @@ static void cmv_decode_intra(CmvContext * s, const uint8_t *buf, const uint8_t *
unsigned
char
*
dst
=
s
->
frame
.
data
[
0
];
int
i
;
for
(
i
=
0
;
i
<
s
->
avctx
->
height
&&
buf
+
s
->
avctx
->
width
<=
buf_end
;
i
++
)
{
for
(
i
=
0
;
i
<
s
->
avctx
->
height
&&
buf
_end
-
buf
>=
s
->
avctx
->
width
;
i
++
)
{
memcpy
(
dst
,
buf
,
s
->
avctx
->
width
);
dst
+=
s
->
frame
.
linesize
[
0
];
buf
+=
s
->
avctx
->
width
;
...
...
@@ -84,7 +84,7 @@ static void cmv_decode_inter(CmvContext * s, const uint8_t *buf, const uint8_t *
i
=
0
;
for
(
y
=
0
;
y
<
s
->
avctx
->
height
/
4
;
y
++
)
for
(
x
=
0
;
x
<
s
->
avctx
->
width
/
4
&&
buf
+
i
<
buf_end
;
x
++
)
{
for
(
x
=
0
;
x
<
s
->
avctx
->
width
/
4
&&
buf
_end
-
buf
>
i
;
x
++
)
{
if
(
buf
[
i
]
==
0xFF
)
{
unsigned
char
*
dst
=
s
->
frame
.
data
[
0
]
+
(
y
*
4
)
*
s
->
frame
.
linesize
[
0
]
+
x
*
4
;
if
(
raw
+
16
<
buf_end
&&
*
raw
==
0xFF
)
{
/* intra */
...
...
@@ -118,7 +118,7 @@ static void cmv_process_header(CmvContext *s, const uint8_t *buf, const uint8_t
{
int
pal_start
,
pal_count
,
i
;
if
(
buf
+
16
>=
buf_end
)
{
if
(
buf
_end
-
buf
<
16
)
{
av_log
(
s
->
avctx
,
AV_LOG_WARNING
,
"truncated header
\n
"
);
return
;
}
...
...
@@ -135,7 +135,7 @@ static void cmv_process_header(CmvContext *s, const uint8_t *buf, const uint8_t
pal_count
=
AV_RL16
(
&
buf
[
14
]);
buf
+=
16
;
for
(
i
=
pal_start
;
i
<
pal_start
+
pal_count
&&
i
<
AVPALETTE_COUNT
&&
buf
+
2
<
buf_end
;
i
++
)
{
for
(
i
=
pal_start
;
i
<
pal_start
+
pal_count
&&
i
<
AVPALETTE_COUNT
&&
buf
_end
-
buf
>=
3
;
i
++
)
{
s
->
palette
[
i
]
=
AV_RB24
(
buf
);
buf
+=
3
;
}
...
...
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