From 89ff236b4f96c409516b5d591f93311487bf470e Mon Sep 17 00:00:00 2001 From: cristy Date: Mon, 16 Sep 2013 22:31:00 +0000 Subject: [PATCH] --- coders/gif.c | 62 +++++++++++++++++++++++++++------------------------- coders/psd.c | 2 +- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/coders/gif.c b/coders/gif.c index 5a44f5b30..98776d489 100644 --- a/coders/gif.c +++ b/coders/gif.c @@ -456,45 +456,47 @@ static MagickBooleanType DecodeImage(Image *image,const ssize_t opacity, if (image->interlace == NoInterlace) offset++; else - switch (pass) { - case 0: - default: + switch (pass) { - offset+=8; - if (offset >= (ssize_t) image->rows) - { - pass++; - offset=4; - } - break; + case 0: + default: + { + offset+=8; + break; + } + case 1: + { + offset+=8; + break; + } + case 2: + { + offset+=4; + break; + } + case 3: + { + offset+=2; + break; + } } - case 1: + if ((pass == 0) && (offset >= (ssize_t) image->rows)) { - offset+=8; - if (offset >= (ssize_t) image->rows) - { - pass++; - offset=2; - } - break; + pass++; + offset=4; } - case 2: + if ((pass == 1) && (offset >= (ssize_t) image->rows)) { - offset+=4; - if (offset >= (ssize_t) image->rows) - { - pass++; - offset=1; - } - break; + pass++; + offset=2; } - case 3: + if ((pass == 2) && (offset >= (ssize_t) image->rows)) { - offset+=2; - break; + pass++; + offset=1; } - } + } } lzw_info=RelinquishLZWInfo(lzw_info); if (y < (ssize_t) image->rows) diff --git a/coders/psd.c b/coders/psd.c index 3cd841a54..b58c3cc5f 100644 --- a/coders/psd.c +++ b/coders/psd.c @@ -849,7 +849,7 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception) (psd_info.mode == DuotoneMode)) { psd_info.color_channels=1; - if (AcquireImageColormap(image,256,exception) == MagickFalse) + if (AcquireImageColormap(image,psd_info.depth != 16 ? 256 : 65536,exception) == MagickFalse) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); image->alpha_trait=psd_info.channels >= 2 ? BlendPixelTrait : UndefinedPixelTrait; -- 2.40.0