shithub: jbig2

Download patch

ref: eedf4c69de311948c88fc26ee71b9227498e9aa0
parent: 20ebea4cc1337c84fb2a8761c4cb8fca72e5d143
author: Sebastian Rasmussen <sebras@gmail.com>
date: Wed May 23 20:52:15 EDT 2018

jbig2dec: Free referred to symbol dictionary upon error.

--- a/jbig2_symbol_dict.c
+++ b/jbig2_symbol_dict.c
@@ -186,6 +186,8 @@
     if (dindex != n_dicts) {
         /* should never happen */
         jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number, "counted %d symbol dictionaries but built a list with %d.", n_dicts, dindex);
+        jbig2_free(ctx->allocator, dicts);
+        return NULL;
     }
 
     return (dicts);