[poppler] 2 commits - utils/pdftocairo.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Sat Sep 21 01:38:52 PDT 2013


 utils/pdftocairo.cc |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 6b30a5214e39993025cf2fb9f221e1360de7fa9c
Merge: 4966b6f dc344b4
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sat Sep 21 10:38:45 2013 +0200

    Merge remote-tracking branch 'origin/poppler-0.24'

commit dc344b410f49410174ee902b7649ebd8c2cb0fa2
Author: Lu Wang <coolwanglu at gmail.com>
Date:   Sat Sep 21 10:37:30 2013 +0200

    pdftocairo: check file opening failure in beginDocument()

diff --git a/utils/pdftocairo.cc b/utils/pdftocairo.cc
index 192d295..e1fb258 100644
--- a/utils/pdftocairo.cc
+++ b/utils/pdftocairo.cc
@@ -26,6 +26,7 @@
 // Copyright (C) 2011 Thomas Freitag <Thomas.Freitag at alfa.de>
 // Copyright (C) 2011 Carlos Garcia Campos <carlosgc at gnome.org>
 // Copyright (C) 2012 Koji Otani <sho at bbr.jp>
+// Copyright (C) 2013 Lu Wang <coolwanglu at 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


More information about the poppler mailing list