shithub: jbig2

Download patch

ref: 39a82096258bf6b106e9dedb3309633e523c7b43
parent: e84ccfbd79e935491a1420955be67af8dac9bc38
author: Sebastian Rasmussen <[email protected]>
date: Fri Dec 7 13:12:48 EST 2018

Clarify the element size of GR_stats when memsetting.

In case Jbig2ArithCx ever changes, but it is unlikely.

--- a/jbig2_symbol_dict.c
+++ b/jbig2_symbol_dict.c
@@ -1043,7 +1043,7 @@
             jbig2_free(ctx->allocator, GB_stats);
             goto cleanup;
         }
-        memset(GR_stats, 0, stats_size);
+        memset(GR_stats, 0, sizeof (Jbig2ArithCx) * stats_size);
     }
 
     segment->result = (void *)jbig2_decode_symbol_dict(ctx, segment, &params, segment_data + offset, segment->data_length - offset, GB_stats, GR_stats);