diff options
Diffstat (limited to 'pdf/xpdf/Function.cc')
-rw-r--r-- | pdf/xpdf/Function.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/pdf/xpdf/Function.cc b/pdf/xpdf/Function.cc index 64ea60c..82bbdce 100644 --- a/pdf/xpdf/Function.cc +++ b/pdf/xpdf/Function.cc @@ -6,11 +6,12 @@ // //======================================================================== -#ifdef __GNUC__ +#include <aconf.h> + +#ifdef USE_GCC_PRAGMAS #pragma implementation #endif -#include <aconf.h> #include <stdlib.h> #include <string.h> #include <ctype.h> @@ -1095,14 +1096,14 @@ GBool PostScriptFunction::parseCode(Stream *str, int *codePtr) { if (!parseCode(str, codePtr)) { return gFalse; } + delete tok; + if (!(tok = getToken(str))) { + error(-1, "Unexpected end of PostScript function stream"); + return gFalse; + } } else { elsePtr = -1; } - delete tok; - if (!(tok = getToken(str))) { - error(-1, "Unexpected end of PostScript function stream"); - return gFalse; - } if (!tok->cmp("if")) { if (elsePtr >= 0) { error(-1, "Got 'if' operator with two blocks in PostScript function"); |