shithub: jbig2

Download patch

ref: a97827f45c90f51502fc0ca9290787b4b660a0ee
parent: 20f6de3d3f3e09060dd20544ebb6d889226c32ba
author: Sebastian Rasmussen <sebras@gmail.com>
date: Wed May 23 20:51:20 EDT 2018

jbig2dec: When a page fails to complete, handle as an error.

Previously this only caused a warning message but didn't fail,
but failing to complete a page means the parsing is somehow broken,
and so it ought to be best to treat it as a fatal error.

--- a/jbig2dec.c
+++ b/jbig2dec.c
@@ -494,8 +494,10 @@
             /* handle embedded streams and work around broken CVision embedded streams */
             if (params.embedded || f_page != NULL) {
                 code = jbig2_complete_page(ctx);
-                if (code < 0)
+                if (code < 0) {
                     jbig2_error(ctx, JBIG2_SEVERITY_WARNING, -1, "unable to complete page");
+                    goto cleanup;
+                }
             }
 
             if (params.output_file == NULL) {