From 6078e6e1a74c423ad0cf61d6ac11e2aac1aa01ee Mon Sep 17 00:00:00 2001 From: homm Date: Wed, 19 Nov 2014 03:15:04 +0300 Subject: [PATCH] this bug actually was in previous implementation too: type switch default case was never achieved because special images is in image8 pointers, not in image32 --- libImaging/Antialias.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/libImaging/Antialias.c b/libImaging/Antialias.c index 5c9514103..a5f0fde83 100644 --- a/libImaging/Antialias.c +++ b/libImaging/Antialias.c @@ -208,7 +208,7 @@ ImagingStretchHorizontal(Imaging imIn, int xsize, int filter) ss += i2f(imIn->image8[yy][x]) * k[x - xmin]; imOut->image8[yy][xx] = clip8(ss); } - } else + } else { switch(imIn->type) { case IMAGING_TYPE_UINT8: /* n-bit grayscale */ @@ -283,13 +283,8 @@ ImagingStretchHorizontal(Imaging imIn, int xsize, int filter) IMAGING_PIXEL_F(imOut, xx, yy) = ss; } break; - default: - ImagingSectionLeave(&cookie); - ImagingDelete(imOut); - free(kk); - free(xbounds); - return (Imaging) ImagingError_ModeError(); } + } } ImagingSectionLeave(&cookie); free(kk); @@ -307,6 +302,9 @@ ImagingStretch(Imaging imIn, int xsize, int ysize, int filter) if (strcmp(imIn->mode, "P") == 0 || strcmp(imIn->mode, "1") == 0) return (Imaging) ImagingError_ModeError(); + if (imIn->type == IMAGING_TYPE_SPECIAL) + return (Imaging) ImagingError_ModeError(); + /* two-pass resize, first pass */ imTemp1 = ImagingStretchHorizontal(imIn, xsize, filter); if ( ! imTemp1)