Code: Select all
--- ImageMagick-6.6.8-5/coders/pdf.c 2011-03-16 12:15:58.000000000 +0900
+++ ImageMagick-6.6.8-5-new/coders/pdf.c 2011-03-16 15:33:45.000000000 +0900
@@ -661,6 +661,7 @@ static Image *ReadPDFImage(const ImageIn
{
ThrowFileException(exception,DelegateError,"PostscriptDelegateFailed",
image_info->filename);
+ image=DestroyImage(image);
return((Image *) NULL);
}
if (LocaleCompare(pdf_image->magick,"BMP") == 0)
I've patched this issue as well.
Code: Select all
--- ImageMagick-6.6.8-5/coders/psd.c 2011-03-16 12:15:58.000000000 +0900
+++ ImageMagick-6.6.8-5-new/coders/psd.c 2011-03-16 19:46:26.000000000 +0900
@@ -589,7 +589,16 @@ static MagickBooleanType ReadPSDLayer(Im
{
if (image->depth == 1)
{
- count=ReadBlob(image,(image->columns+7)/8,pixels);
+ if (image->compression != RLECompression)
+ count=ReadBlob(image,(image->columns+7)/8,pixels);
+ else
+ {
+ count=ReadBlob(image,(size_t) offsets[y],compact_pixels);
+ if (count != (ssize_t) offsets[y])
+ break;
+ count=DecodePSDPixels((size_t) offsets[y],compact_pixels,
+ (ssize_t) 123456,(size_t) ((image->columns+7)/8),pixels);
+ }
if (count < (ssize_t) ((image->columns+7)/8))
break;
}
@@ -649,9 +660,14 @@ static MagickBooleanType ReadPSDLayer(Im
if (image->depth == 1)
{
ssize_t
- bit;
+ bit,
+ nbits;
+
+ nbits = image->columns - x;
+ if (nbits > 8)
+ nbits = 8;
- for (bit=0; bit < (ssize_t) (image->columns % 8); bit++)
+ for (bit=0; bit < nbits; bit++)
{
indexes[x]=((((unsigned char) pixel) & (0x01 << (7-bit)))
!= 0 ? 0 : 255);
but necessary for avoiding bit-wise decoding in that function.