summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2017-05-05 00:47:45 +0200
committerAlbert Astals Cid <aacid@kde.org>2017-05-05 00:47:45 +0200
commitcdab9a2dc27a10c84550db28fac8dbdcdcd4d29d (patch)
tree1b254837cd2491b2e26c18fcf3db81ee80d95eb2
parentb2545e9368a58a6987614f75d39da4568a076881 (diff)
Move the bits sanity checking a bit higher in the function
Saves some time and makes the code simpler as we have to delete one thing less
-rw-r--r--poppler/Gfx.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc
index 6f06f6ca..a2d1db0c 100644
--- a/poppler/Gfx.cc
+++ b/poppler/Gfx.cc
@@ -4407,6 +4407,9 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
}
}
} else {
+ if (bits == 0) {
+ goto err1;
+ }
// get color space and color map
dict->lookup("ColorSpace", &obj1);
@@ -4479,10 +4482,6 @@ void Gfx::doImage(Object *ref, Stream *str, GBool inlineImg) {
obj1.free();
dict->lookup("D", &obj1);
}
- if (bits == 0) {
- delete colorSpace;
- goto err2;
- }
colorMap = new GfxImageColorMap(bits, &obj1, colorSpace);
obj1.free();
if (!colorMap->isOk()) {