shithub: jbig2

Download patch

ref: f5ff079d941a29486cc74bf08715b2a24c775af5
parent: 5e95bfa1388379875a3b329b83046b997c15d853
author: giles <giles@ded80894-8fb9-0310-811b-c03f3676ab4d>
date: Tue Apr 1 15:56:59 EST 2003

Add some additional comments.


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

--- a/jbig2.c
+++ b/jbig2.c
@@ -86,7 +86,7 @@
 }
 
 int
-jbig2_error (Jbig2Ctx *ctx, Jbig2Severity severity, int segment_number,
+jbig2_error(Jbig2Ctx *ctx, Jbig2Severity severity, int segment_number,
 	     const char *fmt, ...)
 {
   char buf[1024];
@@ -288,7 +288,7 @@
 					  ctx->buf_wr_ix - ctx->buf_rd_ix,
 					  &header_size);
 	  if (segment == NULL)
-	    return 0;
+	    return 0; /* need more data */
 	  ctx->buf_rd_ix += header_size;
 
 	  if (ctx->n_segments == ctx->n_segments_max)
@@ -308,7 +308,7 @@
 	case JBIG2_FILE_RANDOM_BODIES:
 	  segment = ctx->segments[ctx->segment_index];
 	  if (segment->data_length > ctx->buf_wr_ix - ctx->buf_rd_ix)
-	    return 0;
+	    return 0; /* need more data */
 	  code = jbig2_parse_segment(ctx, segment, ctx->buf + ctx->buf_rd_ix);
 	  ctx->buf_rd_ix += segment->data_length;
 	  ctx->segment_index++;