[poppler] poppler/CairoOutputDev.cc

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


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

New commits:
commit 77c2e154c2cb57300116ecd4295f1e67b06b411f
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 7275c07..1e2c39e 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
@@ -257,6 +258,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