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
d3834587
Commit
d3834587
authored
Mar 29, 2011
by
Ronald S. Bultje
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dfa: protect pointer range checks against overflows.
parent
a75529e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
dfa.c
libavcodec/dfa.c
+3
-3
No files found.
libavcodec/dfa.c
View file @
d3834587
...
...
@@ -81,7 +81,7 @@ static int decode_tsw1(uint8_t *frame, int width, int height,
v
=
bytestream_get_le16
(
&
src
);
offset
=
(
v
&
0x1FFF
)
<<
1
;
count
=
((
v
>>
13
)
+
2
)
<<
1
;
if
(
frame
-
offset
<
frame_star
t
||
frame_end
-
frame
<
count
)
if
(
frame
-
frame_start
<
offse
t
||
frame_end
-
frame
<
count
)
return
-
1
;
av_memcpy_backptr
(
frame
,
offset
,
count
);
frame
+=
count
;
...
...
@@ -117,7 +117,7 @@ static int decode_dsw1(uint8_t *frame, int width, int height,
v
=
bytestream_get_le16
(
&
src
);
offset
=
(
v
&
0x1FFF
)
<<
1
;
count
=
((
v
>>
13
)
+
2
)
<<
1
;
if
(
frame
-
offset
<
frame_star
t
||
frame_end
-
frame
<
count
)
if
(
frame
-
frame_start
<
offse
t
||
frame_end
-
frame
<
count
)
return
-
1
;
// can't use av_memcpy_backptr() since it can overwrite following pixels
for
(
v
=
0
;
v
<
count
;
v
++
)
...
...
@@ -157,7 +157,7 @@ static int decode_dds1(uint8_t *frame, int width, int height,
v
=
bytestream_get_le16
(
&
src
);
offset
=
(
v
&
0x1FFF
)
<<
2
;
count
=
((
v
>>
13
)
+
2
)
<<
1
;
if
(
frame
-
offset
<
frame_star
t
||
frame_end
-
frame
<
count
*
2
+
width
)
if
(
frame
-
frame_start
<
offse
t
||
frame_end
-
frame
<
count
*
2
+
width
)
return
-
1
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
frame
[
0
]
=
frame
[
1
]
=
...
...
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