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
5350e0fc
Commit
5350e0fc
authored
May 15, 2016
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/iff: rewrite out of bounds checking in writer
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
fd4a52e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
14 deletions
+12
-14
iff.c
libavcodec/iff.c
+12
-14
No files found.
libavcodec/iff.c
View file @
5350e0fc
...
...
@@ -823,7 +823,7 @@ static void decode_delta_j(uint8_t *dst,
int
w
,
int
h
,
int
bpp
,
int
dst_size
)
{
int32_t
pitch
;
uint8_t
*
end
=
dst
+
dst_size
,
*
ptr
;
uint8_t
*
ptr
;
uint32_t
type
,
flag
,
cols
,
groups
,
rows
,
bytes
;
uint32_t
offset
;
int
planepitch_byte
=
(
w
+
7
)
/
8
;
...
...
@@ -855,22 +855,20 @@ static void decode_delta_j(uint8_t *dst,
else
offset
=
((
offset
/
planepitch_byte
)
*
pitch
)
+
(
offset
%
planepitch_byte
);
ptr
=
dst
+
offset
;
if
(
ptr
>=
end
)
return
;
for
(
b
=
0
;
b
<
cols
;
b
++
)
{
for
(
d
=
0
;
d
<
bpp
;
d
++
)
{
uint8_t
value
=
bytestream2_get_byte
(
&
gb
);
if
(
offset
>=
dst_size
)
return
;
ptr
=
dst
+
offset
;
if
(
flag
)
ptr
[
0
]
^=
value
;
else
ptr
[
0
]
=
value
;
ptr
+=
planepitch
;
if
(
ptr
>=
end
)
return
;
offset
+=
planepitch
;
}
}
if
((
cols
*
bpp
)
&
1
)
...
...
@@ -893,21 +891,21 @@ static void decode_delta_j(uint8_t *dst,
for
(
r
=
0
;
r
<
rows
;
r
++
)
{
for
(
d
=
0
;
d
<
bpp
;
d
++
)
{
ptr
=
dst
+
offset
+
(
r
*
pitch
)
+
d
*
planepitch
;
if
(
ptr
>=
end
)
return
;
unsigned
noffset
=
offset
+
(
r
*
pitch
)
+
d
*
planepitch
;
for
(
b
=
0
;
b
<
bytes
;
b
++
)
{
uint8_t
value
=
bytestream2_get_byte
(
&
gb
);
if
(
noffset
>=
dst_size
)
return
;
ptr
=
dst
+
noffset
;
if
(
flag
)
ptr
[
0
]
^=
value
;
else
ptr
[
0
]
=
value
;
ptr
++
;
if
(
ptr
>=
end
)
return
;
noffset
++
;
}
}
}
...
...
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