summaryrefslogtreecommitdiff
authorAlbert Astals Cid <aacid@kde.org>2010-09-21 17:58:43 (GMT)
committer Albert Astals Cid <aacid@kde.org>2010-09-21 17:58:43 (GMT)
commit3422638b2a39cbdd33a114a7d7debc0a5f688501 (patch) (side-by-side diff)
tree69d013851f9b1bc553153c194a818f2d4a74a187
parenta2dab0238a69240dad08eca2083110b52ce488b7 (diff)
downloadpoppler-3422638b2a39cbdd33a114a7d7debc0a5f688501.zip
poppler-3422638b2a39cbdd33a114a7d7debc0a5f688501.tar.gz
Fix crash in broken pdf (parser->getStream() is 0)
Found thanks to PDF provided by Joel Voss of Leviathan Security Group
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--poppler/Gfx.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc
index 50870cc..fc004b8 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;
}