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
d05f72c7
Commit
d05f72c7
authored
Sep 29, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dfa: improve boundary checks in decode_dds1()
Fixes CVE-2012-2798 CC:libav-stable@libav.org
parent
6a99310f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
dfa.c
libavcodec/dfa.c
+6
-4
No files found.
libavcodec/dfa.c
View file @
d05f72c7
...
...
@@ -153,8 +153,7 @@ static int decode_dds1(GetByteContext *gb, uint8_t *frame, int width, int height
bitbuf
=
bytestream2_get_le16u
(
gb
);
mask
=
1
;
}
if
(
frame_end
-
frame
<
2
)
return
AVERROR_INVALIDDATA
;
if
(
bitbuf
&
mask
)
{
v
=
bytestream2_get_le16
(
gb
);
offset
=
(
v
&
0x1FFF
)
<<
2
;
...
...
@@ -168,9 +167,12 @@ static int decode_dds1(GetByteContext *gb, uint8_t *frame, int width, int height
frame
+=
2
;
}
}
else
if
(
bitbuf
&
(
mask
<<
1
))
{
frame
+=
bytestream2_get_le16
(
gb
)
*
2
;
v
=
bytestream2_get_le16
(
gb
)
*
2
;
if
(
frame
-
frame_end
<
v
)
return
AVERROR_INVALIDDATA
;
frame
+=
v
;
}
else
{
if
(
frame_end
-
frame
<
width
+
2
)
if
(
frame_end
-
frame
<
width
+
3
)
return
AVERROR_INVALIDDATA
;
frame
[
0
]
=
frame
[
1
]
=
frame
[
width
]
=
frame
[
width
+
1
]
=
bytestream2_get_byte
(
gb
);
...
...
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