rev 385 - trunk

[email protected] Mon, 3 Jan 2005 21:07:45 -0800 (PST)
Newsgroups gmane.comp.printing.ghostscript.jbig2dec.cvs
Message-ID <[email protected]>
Author: giles
Date: 2005-01-03 21:07:45 -0800 (Mon, 03 Jan 2005)
New Revision: 385

Modified:
   trunk/jbig2_symbol_dict.c
Log:
Properly free the arith and word stream states in symbol dictionary decod=
ing.


Modified: trunk/jbig2_symbol_dict.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/jbig2_symbol_dict.c	2005-01-04 04:53:16 UTC (rev 384)
+++ trunk/jbig2_symbol_dict.c	2005-01-04 05:07:45 UTC (rev 385)
@@ -216,6 +216,7 @@
   uint32_t NSYMSDECODED;
   int32_t SYMWIDTH, TOTWIDTH;
   uint32_t HCFIRSTSYM;
+  Jbig2WordStream *ws =3D NULL;
   Jbig2ArithState *as =3D NULL;
   Jbig2ArithIntCtx *IADH =3D NULL;
   Jbig2ArithIntCtx *IADW =3D NULL;
@@ -231,7 +232,7 @@
   NSYMSDECODED =3D 0;
=20
   if (!params->SDHUFF) {
-      Jbig2WordStream *ws =3D jbig2_word_stream_buf_new(ctx, data, size)=
;
+      ws =3D jbig2_word_stream_buf_new(ctx, data, size);
       as =3D jbig2_arith_new(ctx, ws);
       IADH =3D jbig2_arith_int_ctx_new(ctx);
       IADW =3D jbig2_arith_int_ctx_new(ctx);
@@ -485,6 +486,11 @@
  =20
   jbig2_sd_release(ctx, SDNEWSYMS);
  =20
+  if (!params->SDHUFF) {
+    jbig2_free(ctx->allocator, as); =20
+    jbig2_word_stream_buf_free(ctx, ws);
+  }
+ =20
   return SDEXSYMS;
 }
=20