summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcos H. Woehrmann <marcos.woehrmann@artifex.com>2012-02-20 06:23:06 -0800
committerChris Liddell <chris.liddell@artifex.com>2012-03-15 11:54:23 +0000
commitcbde8e8f823362248e0fb5433845185768759df0 (patch)
tree80f97a94ee21bebe7afb5d401e38b4d6a4ca6d09
parent7339c0fb494ea67e14fa7c0642fab38086f30db6 (diff)
Revert 2e807ab6d4eecfce43561b9e8d5b66386a5165ee and fix fuzzy.c correctly.
-rw-r--r--gs/toolbin/tests/fuzzy.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gs/toolbin/tests/fuzzy.c b/gs/toolbin/tests/fuzzy.c
index 9beb63893..8c1a4a5c0 100644
--- a/gs/toolbin/tests/fuzzy.c
+++ b/gs/toolbin/tests/fuzzy.c
@@ -472,11 +472,10 @@ fuzzy_diff_images (Image *image1, Image *image2, const FuzzyParams *fparams,
{
int width = MIN(image1->width, image2->width);
int height = MIN(image1->height, image2->height);
- int max_width = MAX(image1->height, image2->height);
int max_height = MAX(image1->height, image2->height);
int tolerance = fparams->tolerance;
int window_size = fparams->window_size;
- int row_bytes = max_width * 3;
+ int row_bytes = width * 3;
unsigned int out_buffer_size = (image_out ? row_bytes : 0);
int half_win = window_size >> 1;
uchar **buf1 = alloc_window (row_bytes*2, window_size);
@@ -490,7 +489,7 @@ fuzzy_diff_images (Image *image1, Image *image2, const FuzzyParams *fparams,
if (image_out != NULL)
{
- out_buf = malloc(out_buffer_size);
+ out_buf = malloc(out_buffer_size*2);
if (out_buf == NULL)
printf ("Can't allocate output buffer.\n");
}
@@ -534,7 +533,7 @@ fuzzy_diff_images (Image *image1, Image *image2, const FuzzyParams *fparams,
goto ex;
}
if (out_buf)
- memset(out_buf, 0, out_buffer_size);
+ memset(out_buf, 0, out_buffer_size*2);
if (memcmp(rowmid1, rowmid2, width * 3))
{