shithub: jbig2

Download patch

ref: fe55e5eb9f7aaf06296617d824245581e99f8fd8
parent: 017edd03e56af3d8abca2b9ebcb63ad8984c5f6b
author: Robin Watts <robin.watts@artifex.com>
date: Thu Nov 28 13:24:03 EST 2013

Bug 694362: More tweaking in jbig2dec.

Following more discussions with Simon, and testing within MuPDF, it
appears that the original code was correct. I am therefore restoring
the original behaviour, except with a direct jump to cleanup rather
than relying on dropping into the following case.

This will result in just 1 error being given, and is cleaner, to my
mind.

--- a/jbig2_symbol_dict.c
+++ b/jbig2_symbol_dict.c
@@ -952,8 +952,9 @@
         break;
       case 2:
       default:
-        return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
+        jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,
 	    "symbol dictionary specified invalid huffman table");
+        goto cleanup; /* Jump direct to cleanup to avoid 2 errors being given */
     }
     if (params.SDHUFFDW == NULL)
     {