status=SetImageProgress(image,LoadImagesTag,2*TellBlob(image),
2*GetBlobSize(image));
+ if (status == MagickFalse)
+ return((Image *) NULL);
+
if (logging != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" exit ReadOneJNGImage()");
type[0],type[1],type[2],type[3],(double) length);
if (length > PNG_UINT_31_MAX)
- status=MagickFalse;
+ {
+ status=MagickFalse;
+ break;
+ }
if (count == 0)
ThrowReaderException(CorruptImageError,"CorruptImage");
status=SetImageProgress(image,LoadImageTag,
(MagickOffsetType) (pass * image->rows + y),
num_passes * image->rows);
+
if (status == MagickFalse)
break;
}
status=SetImageProgress(image,LoadImageTag,
(MagickOffsetType) (pass * image->rows + y),
num_passes * image->rows);
+
if (status == MagickFalse)
break;
}
status=SetImageProgress(image,LoadImageTag,
(MagickOffsetType) (pass * image->rows + y),
num_passes * image->rows);
+
if (status == MagickFalse)
break;
}
status=SetImageProgress(image,LoadImageTag,
(MagickOffsetType) (pass * image->rows + y),
num_passes * image->rows);
+
if (status == MagickFalse)
break;
}
status=MagickTrue;
transparent=image_info->type==GrayscaleAlphaType ||
- image_info->type==TrueColorAlphaType || image->alpha_trait != UndefinedPixelTrait;
+ image_info->type==TrueColorAlphaType ||
+ image->alpha_trait != UndefinedPixelTrait;
jng_alpha_sample_depth = 0;
/* Encode alpha as a grayscale PNG blob */
status=OpenBlob(jpeg_image_info,jpeg_image,WriteBinaryBlobMode,
exception);
+ if (status == MagickFalse)
+ ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
+
if (logging != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Creating PNG blob.");
status=OpenBlob(jpeg_image_info,jpeg_image,WriteBinaryBlobMode,
exception);
+ if (status == MagickFalse)
+ ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
+
(void) CopyMagickString(jpeg_image_info->magick,"JPEG",MaxTextExtent);
(void) CopyMagickString(jpeg_image->magick,"JPEG",MaxTextExtent);
" Created jpeg_image, %.20g x %.20g.",(double) jpeg_image->columns,
(double) jpeg_image->rows);
+ if (status == MagickFalse)
+ ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
+
if (jng_color_type == 8 || jng_color_type == 12)
jpeg_image_info->type=GrayscaleType;