Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Raphael Nestler
poppler
Commits
37659c01
Commit
37659c01
authored
Jul 04, 2019
by
Albert Astals Cid
Browse files
Account for verticesA possible overflow in GfxGouraudTriangleShading::parse
fixes oss-fuzz file abort
parent
e69dc7a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
poppler/GfxState.cc
View file @
37659c01
...
...
@@ -4877,7 +4877,13 @@ GfxGouraudTriangleShading *GfxGouraudTriangleShading::parse(GfxResources *res, i
int
oldVertSize
=
vertSize
;
vertSize
=
(
vertSize
==
0
)
?
16
:
2
*
vertSize
;
verticesA
=
(
GfxGouraudVertex
*
)
greallocn
(
verticesA
,
vertSize
,
sizeof
(
GfxGouraudVertex
));
greallocn_checkoverflow
(
verticesA
,
vertSize
,
sizeof
(
GfxGouraudVertex
));
if
(
unlikely
(
!
verticesA
))
{
error
(
errSyntaxWarning
,
-
1
,
"GfxGouraudTriangleShading::parse: vertices size overflow"
);
gfree
(
trianglesA
);
delete
bitBuf
;
return
nullptr
;
}
memset
(
verticesA
+
oldVertSize
,
0
,
(
vertSize
-
oldVertSize
)
*
sizeof
(
GfxGouraudVertex
));
}
verticesA
[
nVerticesA
].
x
=
xMin
+
xMul
*
(
double
)
x
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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