shithub: jbig2

Download patch

ref: 4b953ac9d2db122567d893c706a3e033332d1755
parent: aa58c00fce0d1cf6f40ad618297d1f8d015a621c
author: Sebastian Rasmussen <sebras@gmail.com>
date: Mon Jun 22 21:36:02 EDT 2020

jbig2dec: Free result object upon error allocating referred to segments.

--- a/jbig2_segment.c
+++ b/jbig2_segment.c
@@ -100,6 +100,7 @@
         referred_to_segments = jbig2_new(ctx, uint32_t, referred_to_segment_count * referred_to_segment_size);
         if (referred_to_segments == NULL) {
             jbig2_error(ctx, JBIG2_SEVERITY_FATAL, result->number, "failed to allocate referred to segments");
+            jbig2_free(ctx->allocator, result);
             return NULL;
         }