summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2013-09-21 10:38:45 +0200
committerAlbert Astals Cid <aacid@kde.org>2013-09-21 10:38:45 +0200
commit6b30a5214e39993025cf2fb9f221e1360de7fa9c (patch)
tree5b79d8e65ed73f9ba1eb8965871ef3706096f836 /utils
parent4966b6f4193cc9d13f63e92bdc2aac0c8b78298d (diff)
parentdc344b410f49410174ee902b7649ebd8c2cb0fa2 (diff)
Merge remote-tracking branch 'origin/poppler-0.24'
Diffstat (limited to 'utils')
-rw-r--r--utils/pdftocairo.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/utils/pdftocairo.cc b/utils/pdftocairo.cc
index 82618e9b..f6ddaaeb 100644
--- a/utils/pdftocairo.cc
+++ b/utils/pdftocairo.cc
@@ -26,6 +26,7 @@
// Copyright (C) 2011 Thomas Freitag <Thomas.Freitag@alfa.de>
// Copyright (C) 2011 Carlos Garcia Campos <carlosgc@gnome.org>
// Copyright (C) 2012 Koji Otani <sho@bbr.jp>
+// Copyright (C) 2013 Lu Wang <coolwanglu@gmail.com>
//
// To see a description of the changes please see the Changelog file that
// came with your tarball or type make ChangeLog if you are building from git
@@ -484,7 +485,13 @@ static void beginDocument(GooString *outputFileName, double w, double h)
if (outputFileName->cmp("fd://0") == 0)
output_file = stdout;
else
+ {
output_file = fopen(outputFileName->getCString(), "wb");
+ if (!output_file) {
+ fprintf(stderr, "Error opening output file %s\n", outputFileName->getCString());
+ exit(2);
+ }
+ }
if (ps || eps) {
#if CAIRO_HAS_PS_SURFACE