summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-03-08 23:42:24 +0100
committerTor Andersson <tor.andersson@artifex.com>2016-03-14 17:08:29 +0100
commitc024ff2f58a98757bc69705ca6ddf865a58dbb45 (patch)
tree38f8ce25634e40f8b16c96c1466876f72b9d6490
parent9f737805b3ce0bfe2ed9a5d64e3962d95faca0fd (diff)
downloadmupdf-c024ff2f58a98757bc69705ca6ddf865a58dbb45.tar.xz
Fix 696507: Clamp correct values in fz_invert_pixmap_rect.
The loop is exclusive, but the clamp check was as if it were inclusive.
-rw-r--r--source/fitz/pixmap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/fitz/pixmap.c b/source/fitz/pixmap.c
index 61c91e2a..b8f1f843 100644
--- a/source/fitz/pixmap.c
+++ b/source/fitz/pixmap.c
@@ -523,10 +523,10 @@ void fz_invert_pixmap_rect(fz_context *ctx, fz_pixmap *image, const fz_irect *re
unsigned char *p;
int x, y, n;
- int x0 = fz_clampi(rect->x0 - image->x, 0, image->w - 1);
- int x1 = fz_clampi(rect->x1 - image->x, 0, image->w - 1);
- int y0 = fz_clampi(rect->y0 - image->y, 0, image->h - 1);
- int y1 = fz_clampi(rect->y1 - image->y, 0, image->h - 1);
+ int x0 = fz_clampi(rect->x0 - image->x, 0, image->w);
+ int x1 = fz_clampi(rect->x1 - image->x, 0, image->w);
+ int y0 = fz_clampi(rect->y0 - image->y, 0, image->h);
+ int y1 = fz_clampi(rect->y1 - image->y, 0, image->h);
for (y = y0; y < y1; y++)
{