Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
poppler
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Adam Reichold
poppler
Commits
ad107bbb
Commit
ad107bbb
authored
Aug 30, 2018
by
Albert Astals Cid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JBIG2Bitmap: Fix overflow check
Fixes oss-fuzz/10113
parent
e3a3e3fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
poppler/JBIG2Stream.cc
poppler/JBIG2Stream.cc
+9
-7
No files found.
poppler/JBIG2Stream.cc
View file @
ad107bbb
...
...
@@ -2966,17 +2966,19 @@ JBIG2Bitmap *JBIG2Stream::readGenericBitmap(GBool mmr, int w, int h,
if
(
mmr
)
{
mmrDecoder
->
reset
();
if
(
w
>
INT_MAX
-
2
)
{
error
(
errSyntaxError
,
curStr
->
getPos
(),
"Bad width in JBIG2 generic bitmap"
);
delete
bitmap
;
return
nullptr
;
}
// 0 <= codingLine[0] < codingLine[1] < ... < codingLine[n] = w
// ---> max codingLine size = w + 1
// refLine has one extra guard entry at the end
// ---> max refLine size = w + 2
codingLine
=
(
int
*
)
gmallocn
(
w
+
1
,
sizeof
(
int
));
refLine
=
(
int
*
)
gmallocn
(
w
+
2
,
sizeof
(
int
));
codingLine
=
(
int
*
)
gmallocn_checkoverflow
(
w
+
1
,
sizeof
(
int
));
refLine
=
(
int
*
)
gmallocn_checkoverflow
(
w
+
2
,
sizeof
(
int
));
if
(
unlikely
(
!
codingLine
||
!
refLine
))
{
error
(
errSyntaxError
,
curStr
->
getPos
(),
"Bad width in JBIG2 generic bitmap"
);
delete
bitmap
;
return
nullptr
;
}
memset
(
refLine
,
0
,
(
w
+
2
)
*
sizeof
(
int
));
for
(
i
=
0
;
i
<
w
+
1
;
++
i
)
codingLine
[
i
]
=
w
;
...
...
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