assert(cache_info->signature == MagickCoreSignature);
if (cache_info->type == UndefinedCache)
return((Quantum *) NULL);
+ if ((width == 0) || (height == 0))
+ {
+ (void) ThrowMagickException(exception,GetMagickModule(),CacheError,
+ "NoPixelsDefinedInCache","`%s'",cache_info->filename);
+ return((Quantum *) NULL);
+ }
(void) memset(&nexus_info->region,0,sizeof(nexus_info->region));
assert(nexus_info->signature == MagickCoreSignature);
if (((cache_info->type == MemoryCache) || (cache_info->type == MapCache)) &&
/*
Convert to 8 bit color-mapped X canvas.
*/
- if (resource_info->color_recovery &&
- resource_info->quantize_info->dither_method != NoDitherMethod)
+ if ((resource_info->color_recovery != MagickFalse) &&
+ (resource_info->quantize_info->dither_method != NoDitherMethod))
{
XDitherImage(canvas,ximage,exception);
break;
/*
Convert to 8 bit continuous-tone X canvas.
*/
- if (resource_info->color_recovery &&
- resource_info->quantize_info->dither_method != NoDitherMethod)
+ if ((resource_info->color_recovery != MagickFalse) &&
+ (resource_info->quantize_info->dither_method != NoDitherMethod))
{
XDitherImage(canvas,ximage,exception);
break;
case 16:
{
pixel->index=(MagickRealType) ConstrainColormapIndex(image,(ssize_t)
- ((*p << 8) | *(p+1)),exception);
+ (((size_t) *p << 8) | (size_t) *(p+1)),exception);
p+=2;
break;
}
(void) ThrowMagickException(exception,GetMagickModule(),
CorruptImageError,"ImageDepthNotSupported","`%s'",image->filename);
}
- *length=(size_t) (*p++)+1;
+ *length=((size_t) *p++)+1;
return;
}
switch (image->depth)