shithub: jbig2

Download patch

ref: 9d7b467d807844ab3d13e9d9f518bac58efc5620
parent: 6e571f5a2af94e4352dca73e71cfa24bd3072076
author: Sebastian Rasmussen <sebras@gmail.com>
date: Sun Mar 25 22:10:10 EDT 2018

Fix 699142: Adaptive pixels can not be pixel to be predicted.

The fix for 699127 didn't account for the adaptive pixel location
being that of the pixel to be predicted. This is of course invalid,
and this is now recitified.

--- a/jbig2_generic.c
+++ b/jbig2_generic.c
@@ -112,7 +112,7 @@
 }
 
 #define pixel_outside_field(x, y) \
-    ((y) < -128 || (y) > 0 || (x) < -128 || ((y) < 0 && (x) > 127) || ((y) == 0 && (x) > 0))
+    ((y) < -128 || (y) > 0 || (x) < -128 || ((y) < 0 && (x) > 127) || ((y) == 0 && (x) >= 0))
 
 static int
 jbig2_decode_generic_template0_unopt(Jbig2Ctx *ctx,