shithub: jbig2

Download patch

ref: b8ebfef9bf8e78df6edd3c4e94f5d6e800d608d2
parent: 7496658740e6dc94ce794e22eaea85c697f1341a
author: Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
date: Tue Sep 22 16:36:02 EDT 2015

Bug 696052: Check that cloned image exists before proceeding further.

--- a/jbig2_refinement.c
+++ b/jbig2_refinement.c
@@ -508,6 +508,9 @@
     /* the reference is just (a subset of) the page buffer */
     params.reference = jbig2_image_clone(ctx,
       ctx->pages[ctx->current_page].image);
+    if (params.reference == NULL)
+      return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
+        "could not clone reference bitmap!");
     /* TODO: subset the image if appropriate */
   }