summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2010-09-21 18:58:43 +0100
committerAlbert Astals Cid <aacid@kde.org>2010-09-21 18:58:43 +0100
commit3422638b2a39cbdd33a114a7d7debc0a5f688501 (patch)
tree69d013851f9b1bc553153c194a818f2d4a74a187
parenta2dab0238a69240dad08eca2083110b52ce488b7 (diff)
Fix crash in broken pdf (parser->getStream() is 0)
Found thanks to PDF provided by Joel Voss of Leviathan Security Group
-rw-r--r--poppler/Gfx.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc
index 50870cc1..fc004b8b 100644
--- a/poppler/Gfx.cc
+++ b/poppler/Gfx.cc
@@ -4449,8 +4449,13 @@ Stream *Gfx::buildImageStream() {
obj.free();
// make stream
- str = new EmbedStream(parser->getStream(), &dict, gFalse, 0);
- str = str->addFilters(&dict);
+ if (parser->getStream()) {
+ str = new EmbedStream(parser->getStream(), &dict, gFalse, 0);
+ str = str->addFilters(&dict);
+ } else {
+ str = NULL;
+ dict.free();
+ }
return str;
}