shithub: jbig2

Download patch

ref: e74ec354988c96bbc2320b0594a5b3eeb39ef1d3
parent: 9305488893accbdbee96a2a3aedfe33fcaf93d6d
author: Sebastian Rasmussen <[email protected]>
date: Wed Jul 4 08:36:41 EDT 2018

jbig2dec: Fix where end row of stripe was only updated locally.

--- a/jbig2_page.c
+++ b/jbig2_page.c
@@ -163,20 +163,20 @@
 int
 jbig2_end_of_stripe(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data)
 {
-    Jbig2Page page = ctx->pages[ctx->current_page];
+    Jbig2Page *page = &ctx->pages[ctx->current_page];
     uint32_t end_row;
 
     if (segment->data_length < 4)
         return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number, "segment too short");
     end_row = jbig2_get_uint32(segment_data);
-    if (end_row < page.end_row) {
+    if (end_row < page->end_row) {
         jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,
-                    "end of stripe segment with non-positive end row advance (new end row %d vs current end row %d)", end_row, page.end_row);
+                    "end of stripe segment with non-positive end row advance (new end row %d vs current end row %d)", end_row, page->end_row);
     } else {
-        jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number, "end of stripe: advancing end row from %u to %u", page.end_row, end_row);
+        jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number, "end of stripe: advancing end row from %u to %u", page->end_row, end_row);
     }
 
-    page.end_row = end_row;
+    page->end_row = end_row;
 
     return 0;
 }