summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Giles <ralph.giles@artifex.com>2005-04-05 19:37:22 +0000
committerRalph Giles <ralph.giles@artifex.com>2005-04-05 19:37:22 +0000
commit6c1241cc08cce443698e31a25039206aa6bfe17f (patch)
tree2c4c6431502b711ca4536455d31f9cd8dcb55506
parent24868e2e07d34896f7dcfa963b65237add283cfd (diff)
downloadghostpdl-6c1241cc08cce443698e31a25039206aa6bfe17f.tar.gz
Disable non-fatal jbig2 debug messages unless JBIG2_DEBUG is defined in the
C preprocessor. Previously, all messages were reported in the general gs debug build, which was distracting. Also, initialize the global context pointer to NULL. This isn't necessary in the standard call order, but is extra insurance against an improper free. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@5830 a1074d23-0009-0410-80fe-cf8c14f379e6
-rw-r--r--gs/src/sjbig2.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gs/src/sjbig2.c b/gs/src/sjbig2.c
index 02cb0bd8b..76133d89c 100644
--- a/gs/src/sjbig2.c
+++ b/gs/src/sjbig2.c
@@ -19,7 +19,7 @@
#include "stdint_.h"
#include "memory_.h"
-#include "stdio_.h" /* for debug printouts */
+#include "stdio_.h" /* sprintf() for debug output */
#include "gserrors.h"
#include "gserror.h"
@@ -49,7 +49,7 @@ s_jbig2decode_error(void *error_callback_data, const char *msg, Jbig2Severity se
char segment[22];
switch (severity) {
-#ifdef DEBUG /* verbose reporting when debugging */
+#ifdef JBIG2_DEBUG /* verbose reporting when debugging */
case JBIG2_SEVERITY_DEBUG:
type = "DEBUG"; break;;
case JBIG2_SEVERITY_INFO:
@@ -62,7 +62,7 @@ s_jbig2decode_error(void *error_callback_data, const char *msg, Jbig2Severity se
case JBIG2_SEVERITY_WARNING:
return 0;
break;;
-#endif /* DEBUG */
+#endif /* JBIG2_DEBUG */
case JBIG2_SEVERITY_FATAL:
type = "FATAL ERROR decoding image:"; break;;
default: type = "unknown message:"; break;;
@@ -217,6 +217,7 @@ s_jbig2decode_set_defaults(stream_state *ss)
stream_jbig2decode_state *const state = (stream_jbig2decode_state *) ss;
/* state->global_ctx is not owned by us */
+ state->global_ctx = NULL;
state->decode_ctx = NULL;
state->image = NULL;
state->offset = 0;