[poppler] Branch 'poppler-0.12' - poppler/CairoOutputDev.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Sun Nov 22 11:21:19 PST 2009


 poppler/CairoOutputDev.cc |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 119071cb9a6144b6268a7ff9b6341ad0cc75d9ae
Author: David Benjamin <davidben at mit.edu>
Date:   Sun Nov 22 20:19:29 2009 +0100

    Do not crash on malformed files
    
    bug 24575

diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc
index a19f42c..0f7739a 100644
--- a/poppler/CairoOutputDev.cc
+++ b/poppler/CairoOutputDev.cc
@@ -24,6 +24,7 @@
 // Copyright (C) 2008 Michael Vrable <mvrable at cs.ucsd.edu>
 // Copyright (C) 2008 Chris Wilson <chris at chris-wilson.co.uk>
 // Copyright (C) 2008 Hib Eris <hib at hiberis.nl>
+// Copyright (C) 2009 David Benjamin <davidben at mit.edu>
 //
 // 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
@@ -255,6 +256,10 @@ void CairoOutputDev::saveState(GfxState *state) {
 
 void CairoOutputDev::restoreState(GfxState *state) {
   LOG(printf ("restore\n"));
+  if (!state->hasSaves()) {
+    error(-1, "restoreState on an empty state stack");
+    return;
+  }
   cairo_restore (cairo);
   if (cairo_shape)
       cairo_restore (cairo_shape);


More information about the poppler mailing list