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
f707a5eb
Commit
f707a5eb
authored
Apr 20, 2005
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
buffer overflows
Originally committed as revision 4142 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
856dbbff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
indeo2.c
libavcodec/indeo2.c
+15
-3
No files found.
libavcodec/indeo2.c
View file @
f707a5eb
...
@@ -53,7 +53,7 @@ if (value > 255) \
...
@@ -53,7 +53,7 @@ if (value > 255) \
else if (value < 0) \
else if (value < 0) \
value = 0; \
value = 0; \
static
void
ir2_decode_plane
(
Ir2Context
*
ctx
,
int
width
,
int
height
,
uint8_t
*
dst
,
int
stride
,
static
int
ir2_decode_plane
(
Ir2Context
*
ctx
,
int
width
,
int
height
,
uint8_t
*
dst
,
int
stride
,
const
uint8_t
*
table
)
const
uint8_t
*
table
)
{
{
int
i
;
int
i
;
...
@@ -62,11 +62,16 @@ static void ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *ds
...
@@ -62,11 +62,16 @@ static void ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *ds
int
c
;
int
c
;
int
t
;
int
t
;
if
(
width
&
1
)
return
-
1
;
/* first line contain absolute values, other lines contain deltas */
/* first line contain absolute values, other lines contain deltas */
while
(
out
<
width
){
while
(
out
<
width
){
c
=
ir2_get_code
(
&
ctx
->
gb
);
c
=
ir2_get_code
(
&
ctx
->
gb
);
if
(
c
>
0x80
)
{
/* we have a run */
if
(
c
>
0x80
)
{
/* we have a run */
c
-=
0x80
;
c
-=
0x80
;
if
(
out
+
c
*
2
>
width
)
return
-
1
;
for
(
i
=
0
;
i
<
c
*
2
;
i
++
)
for
(
i
=
0
;
i
<
c
*
2
;
i
++
)
dst
[
out
++
]
=
0x80
;
dst
[
out
++
]
=
0x80
;
}
else
{
/* copy two values from table */
}
else
{
/* copy two values from table */
...
@@ -82,6 +87,8 @@ static void ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *ds
...
@@ -82,6 +87,8 @@ static void ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *ds
c
=
ir2_get_code
(
&
ctx
->
gb
);
c
=
ir2_get_code
(
&
ctx
->
gb
);
if
(
c
>
0x80
)
{
/* we have a skip */
if
(
c
>
0x80
)
{
/* we have a skip */
c
-=
0x80
;
c
-=
0x80
;
if
(
out
+
c
*
2
>
width
)
return
-
1
;
for
(
i
=
0
;
i
<
c
*
2
;
i
++
)
{
for
(
i
=
0
;
i
<
c
*
2
;
i
++
)
{
dst
[
out
]
=
dst
[
out
-
stride
];
dst
[
out
]
=
dst
[
out
-
stride
];
out
++
;
out
++
;
...
@@ -99,16 +106,20 @@ static void ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *ds
...
@@ -99,16 +106,20 @@ static void ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *ds
}
}
dst
+=
stride
;
dst
+=
stride
;
}
}
return
0
;
}
}
static
void
ir2_decode_plane_inter
(
Ir2Context
*
ctx
,
int
width
,
int
height
,
uint8_t
*
dst
,
int
stride
,
static
int
ir2_decode_plane_inter
(
Ir2Context
*
ctx
,
int
width
,
int
height
,
uint8_t
*
dst
,
int
stride
,
const
uint8_t
*
table
)
const
uint8_t
*
table
)
{
{
int
j
;
int
j
;
int
out
=
0
;
int
out
=
0
;
int
c
;
int
c
;
int
t
;
int
t
;
if
(
width
&
1
)
return
-
1
;
for
(
j
=
0
;
j
<
height
;
j
++
){
for
(
j
=
0
;
j
<
height
;
j
++
){
out
=
0
;
out
=
0
;
while
(
out
<
width
){
while
(
out
<
width
){
...
@@ -129,6 +140,7 @@ static void ir2_decode_plane_inter(Ir2Context *ctx, int width, int height, uint8
...
@@ -129,6 +140,7 @@ static void ir2_decode_plane_inter(Ir2Context *ctx, int width, int height, uint8
}
}
dst
+=
stride
;
dst
+=
stride
;
}
}
return
0
;
}
}
static
int
ir2_decode_frame
(
AVCodecContext
*
avctx
,
static
int
ir2_decode_frame
(
AVCodecContext
*
avctx
,
...
...
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