summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'base/gxscanc.c')
-rw-r--r--base/gxscanc.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/base/gxscanc.c b/base/gxscanc.c
index 7776d486..9842b2c3 100644
--- a/base/gxscanc.c
+++ b/base/gxscanc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -3627,7 +3627,9 @@ no_merge:
} else if (sx < ex) {
/* Lines increasing in x. (Rightwards, rising) */
int phase1_x_steps, phase3_x_steps;
- fixed x_steps = ex - sx;
+ /* Use unsigned int here, to allow for extreme cases like
+ * ex = 0x7fffffff, sx = 0x80000000 */
+ unsigned int x_steps = ex - sx;
/* Phase 1: */
if (phase1_y_steps) {
@@ -3693,7 +3695,9 @@ no_merge:
} else {
/* Lines decreasing in x. (Leftwards, rising) */
int phase1_x_steps, phase3_x_steps;
- fixed x_steps = sx - ex;
+ /* Use unsigned int here, to allow for extreme cases like
+ * sx = 0x7fffffff, ex = 0x80000000 */
+ unsigned int x_steps = sx - ex;
/* Phase 1: */
if (phase1_y_steps) {
@@ -3813,7 +3817,9 @@ endFallingLeftOnEdgeOfPixel:
} else if (sx < ex) {
/* Lines increasing in x. (Rightwards, falling) */
int phase1_x_steps, phase3_x_steps;
- fixed x_steps = ex - sx;
+ /* Use unsigned int here, to allow for extreme cases like
+ * ex = 0x7fffffff, sx = 0x80000000 */
+ unsigned int x_steps = ex - sx;
/* Phase 1: */
if (phase1_y_steps) {
@@ -3878,7 +3884,9 @@ endFallingRightOnEdgeOfPixel:
} else {
/* Lines decreasing in x. (Falling) */
int phase1_x_steps, phase3_x_steps;
- fixed x_steps = sx - ex;
+ /* Use unsigned int here, to allow for extreme cases like
+ * sx = 0x7fffffff, ex = 0x80000000 */
+ unsigned int x_steps = sx - ex;
/* Phase 1: */
if (phase1_y_steps) {