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
This commit is contained in:
homm 2014-11-19 03:15:04 +03:00
parent 24ed800fae
commit 6078e6e1a7

View File

@ -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)