From 502e56243e3bf70d95b85f67639001b26fdb1528 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Tue, 5 Jul 2016 02:11:57 +0800 Subject: Fix bug in optimized clearing of CMYK pixmaps. The implementation assumed that a variable contained a number of 32-bit words when it actually contained the number of bytes hence fz_clear_pixmap_with_value() touched memory outside of the samples array. --- source/fitz/pixmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') diff --git a/source/fitz/pixmap.c b/source/fitz/pixmap.c index 6a7f8919..d278900a 100644 --- a/source/fitz/pixmap.c +++ b/source/fitz/pixmap.c @@ -368,7 +368,7 @@ clear_cmyk_bitmap(unsigned char *samples, int w, int h, int stride, int value, i const uint32_t a0 = d.word; while (h--) { - size_t WW = W; + size_t WW = W >> 2; while (WW--) { *s++ = a0; -- cgit v1.2.3