summaryrefslogtreecommitdiff
path: root/poppler/JBIG2Stream.cc
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2017-09-10 17:41:47 +0200
committerAlbert Astals Cid <aacid@kde.org>2017-09-10 17:41:47 +0200
commit325887ebef8ea1c6ef9d3607a59d95ffea383986 (patch)
tree35902ace119929dfb84745f06b67e494a1c87012 /poppler/JBIG2Stream.cc
parentf253a28f4c5bb65c363d31b8b46f984c660499ee (diff)
Make JBIG2Stream::readGenericBitmap return cleanly on error
instead of causing abort Also fixes warning when compiled with newer gcc
Diffstat (limited to 'poppler/JBIG2Stream.cc')
-rw-r--r--poppler/JBIG2Stream.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/poppler/JBIG2Stream.cc b/poppler/JBIG2Stream.cc
index 50c6eee6..bda7f42e 100644
--- a/poppler/JBIG2Stream.cc
+++ b/poppler/JBIG2Stream.cc
@@ -2964,8 +2964,8 @@ JBIG2Bitmap *JBIG2Stream::readGenericBitmap(GBool mmr, int w, int h,
mmrDecoder->reset();
if (w > INT_MAX - 2) {
error(errSyntaxError, curStr->getPos(), "Bad width in JBIG2 generic bitmap");
- // force a call to gmalloc(-1), which will throw an exception
- w = -3;
+ delete bitmap;
+ return NULL;
}
// 0 <= codingLine[0] < codingLine[1] < ... < codingLine[n] = w
// ---> max codingLine size = w + 1