From 7700e60d61fdadc29144230260a2fcf90d885aa7 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Sat, 21 Nov 2009 02:09:45 -0500 Subject: [PATCH] Do not restoreState on empty stack Fixes crash in #24575. Signed-off-by: David Benjamin --- poppler/Gfx.cc | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc index 2a4c9b8..19739f1 100644 --- a/poppler/Gfx.cc +++ b/poppler/Gfx.cc @@ -4725,6 +4725,10 @@ void Gfx::saveState() { } void Gfx::restoreState() { + if (!state->hasSaves()) { + error(-1, "restoreState on an empty state stack"); + return; + } state = state->restore(); out->restoreState(state); } -- 1.6.3.3