shithub: jbig2

Download patch

ref: e641718f01a0a45ec8cfc89602daa345bb9383f8
parent: e3a50c85fa43ebff2b3164e05cf3988c326cfb27
author: giles <giles@ded80894-8fb9-0310-811b-c03f3676ab4d>
date: Mon Jan 3 23:40:18 EST 2005

Minor cleanup: remove an unnecessary check before releasing an immediate 
text region after decode and composite, and simply reference to the page 
image itself.


git-svn-id: http://svn.ghostscript.com/jbig2dec/trunk@382 ded80894-8fb9-0310-811b-c03f3676ab4d

--- a/jbig2_text.c
+++ b/jbig2_text.c
@@ -328,7 +328,7 @@
     int offset = 0;
     Jbig2RegionSegmentInfo region_info;
     Jbig2TextRegionParams params;
-    Jbig2Image *image, *page_image;
+    Jbig2Image *image;
     Jbig2SymbolDict **dicts;
     int n_dicts;
     uint16_t flags;
@@ -444,7 +444,6 @@
 	}
     }
 
-    page_image = ctx->pages[ctx->current_page].image;
     image = jbig2_image_new(ctx, region_info.width, region_info.height);
 
     code = jbig2_decode_text_region(ctx, segment, &params,
@@ -459,12 +458,12 @@
         segment->result = image;
     } else {
         /* otherwise composite onto the page */
+	Jbig2Image *page_image = ctx->pages[ctx->current_page].image;
         jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number, 
             "composing %dx%d decoded text region onto page at (%d, %d)",
             region_info.width, region_info.height, region_info.x, region_info.y);
         jbig2_image_compose(ctx, page_image, image, region_info.x, region_info.y, JBIG2_COMPOSE_OR);
-        if (image != page_image)
-            jbig2_image_release(ctx, image);
+        jbig2_image_release(ctx, image);
     }
     
     /* success */