From: cristy Date: Fri, 8 Oct 2010 23:46:21 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~8718 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4484e338a01a81df4fb5e32787eac5a48c83130a;p=imagemagick --- diff --git a/ChangeLog b/ChangeLog index e8a2535eb..38797dafd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,7 +13,7 @@ 2010-10-05 6.6.4-10 Cristy * Add support for "pattern:vertical2" and "pattern:horizontal2". * Add support for "pattern:vertical3" and "pattern:horizontal3". - * Properly handle PSD layers with negative heights. + * Properly handle PSD layers with negative offsets. 2010-10-03 6.6.4-9 Cristy * Fix memory assertion with --enable-embeddable (reference diff --git a/coders/psd.c b/coders/psd.c index f91cafbc7..496992ba5 100644 --- a/coders/psd.c +++ b/coders/psd.c @@ -995,15 +995,19 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception) sizeof(*layer_info)); for (i=0; i < number_layers; i++) { + int + x, + y; + if (image->debug != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(), " reading layer #%.20g",(double) i+1); layer_info[i].page.y=(int) ReadBlobMSBLong(image); layer_info[i].page.x=(int) ReadBlobMSBLong(image); - layer_info[i].page.height=(ssize_t) - (ReadBlobMSBLong(image)-layer_info[i].page.y); - layer_info[i].page.width=(ssize_t) - (ReadBlobMSBLong(image)-layer_info[i].page.x); + y=(int) ReadBlobMSBLong(image); + x=(int) ReadBlobMSBLong(image); + layer_info[i].page.width=(ssize_t) (x-layer_info[i].page.x); + layer_info[i].page.height=(ssize_t) (y-layer_info[i].page.y); layer_info[i].channels=ReadBlobMSBShort(image); if (layer_info[i].channels > MaxPSDChannels) ThrowReaderException(CorruptImageError,"MaximumChannelsExceeded");