GetPPException;
kernel_info=AcquireKernelInfo((const char *) NULL);
- kernel_info->width=order_;
- kernel_info->height=order_;
- kernel_info->values=(MagickRealType *) AcquireAlignedMemory(order_,
- order_*sizeof(*kernel_info->values));
- if (kernel_info->values != (MagickRealType *) NULL)
+ if (kernel_info != (KernelInfo *) NULL)
{
- MagickCore::Image
- *newImage;
+ kernel_info->width=order_;
+ kernel_info->height=order_;
+ kernel_info->values=(MagickRealType *) AcquireAlignedMemory(order_,
+ order_*sizeof(*kernel_info->values));
+ if (kernel_info->values != (MagickRealType *) NULL)
+ {
+ MagickCore::Image
+ *newImage;
- for (ssize_t i=0; i < (ssize_t) (order_*order_); i++)
- kernel_info->values[i]=color_matrix_[i];
- newImage=ColorMatrixImage(image(),kernel_info,&exceptionInfo);
- replaceImage(newImage);
+ for (ssize_t i=0; i < (ssize_t) (order_*order_); i++)
+ kernel_info->values[i]=color_matrix_[i];
+ newImage=ColorMatrixImage(image(),kernel_info,&exceptionInfo);
+ replaceImage(newImage);
+ }
+ kernel_info=DestroyKernelInfo(kernel_info);
}
- kernel_info=DestroyKernelInfo(kernel_info);
ThrowPPException;
}
std::string Magick::Options::magick(void) const
{
- if (_imageInfo->magick && *_imageInfo->magick)
+ if (*_imageInfo->magick)
return(std::string(_imageInfo->magick));
return(std::string());
Free X resources.
*/
if (windows->image.mapped != MagickFalse)
- (void) XWithdrawWindow(display,windows->image.id,windows->image.screen); XDelay(display,SuspendTime);
+ (void) XWithdrawWindow(display,windows->image.id,windows->image.screen);
+ XDelay(display,SuspendTime);
(void) XFreeStandardColormap(display,icon_visual,icon_map,icon_pixel);
if (resource_info->map_type == (char *) NULL)
(void) XFreeStandardColormap(display,visual_info,map_info,pixel);
GetPixelInfo(image,&target[1]);
p=GetCacheViewVirtualPixels(image_view,(ssize_t) image->columns-1,0,1,1,
exception);
- GetPixelInfoPixel(image,p,&target[1]);
+ if (p == (const Quantum *) NULL)
+ GetPixelInfoPixel(image,p,&target[1]);
GetPixelInfo(image,&target[2]);
p=GetCacheViewVirtualPixels(image_view,0,(ssize_t) image->rows-1,1,1,
exception);
- GetPixelInfoPixel(image,p,&target[2]);
+ if (p == (const Quantum *) NULL)
+ GetPixelInfoPixel(image,p,&target[2]);
status=MagickTrue;
GetPixelInfo(image,&zero);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
xml=p+offset;
entity=strchr(xml,';');
}
- (void) CopyMagickMemory(xml+length,entity+1,strlen(entity));
+ if (entity != (char *) NULL)
+ (void) CopyMagickMemory(xml+length,entity+1,strlen(entity));
(void) strncpy(xml,entities[i],length);
}
}
xml_info->tag=ConstantString(tag);
else
xml_info=AddChildToXMLTree(xml_info,tag,strlen(xml_info->content));
- xml_info->attributes=attributes;
+ if (xml_info != (XMLTreeInfo *) NULL)
+ xml_info->attributes=attributes;
root->node=xml_info;
}
status=XGetWMName(display,target,&window_name);
if (status == True)
{
- if ((image_info->filename != (char *) NULL) &&
- (*image_info->filename == '\0'))
+ if (*image_info->filename == '\0')
(void) CopyMagickString(image->filename,(char *) window_name.value,
(size_t) window_name.nitems+1);
(void) XFree((void *) window_name.value);
if (tile_offset == -1)
continue;
restore_offset=TellBlob(image);
+ if (restore_offset < 0)
+ continue;
offset=SeekBlob(image,(MagickOffsetType) tile_offset,SEEK_SET);
if (offset != (MagickOffsetType) tile_offset)
continue;
Add namespace to XMP profile.
*/
xmp_profile=StringToStringInfo("http://ns.adobe.com/xap/1.0/ ");
- ConcatenateStringInfo(xmp_profile,profile);
- GetStringInfoDatum(xmp_profile)[28]='\0';
- for (i=0; i < (ssize_t) GetStringInfoLength(xmp_profile); i+=65533L)
- {
- length=MagickMin(GetStringInfoLength(xmp_profile)-i,65533L);
- jpeg_write_marker(jpeg_info,XML_MARKER,
- GetStringInfoDatum(xmp_profile)+i,(unsigned int) length);
- }
- xmp_profile=DestroyStringInfo(xmp_profile);
+ if (xmp_profile != (StringINfo *) NULL)
+ {
+ ConcatenateStringInfo(xmp_profile,profile);
+ GetStringInfoDatum(xmp_profile)[28]='\0';
+ for (i=0; i < (ssize_t) GetStringInfoLength(xmp_profile); i+=65533L)
+ {
+ length=MagickMin(GetStringInfoLength(xmp_profile)-i,65533L);
+ jpeg_write_marker(jpeg_info,XML_MARKER,
+ GetStringInfoDatum(xmp_profile)+i,(unsigned int) length);
+ }
+ xmp_profile=DestroyStringInfo(xmp_profile);
+ }
}
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
"%s profile: %.20g bytes",name,(double) GetStringInfoLength(profile));
/* WPG2 raster reader. */
static int UnpackWPG2Raster(Image *image,int bpp,ExceptionInfo *exception)
{
+ int
+ RunCount,
+ XorMe = 0;
+
size_t
x,
y;
ssize_t
ldblk;
- int XorMe = 0;
-
unsigned int
SampleSize=1;
unsigned char
bbuf,
*BImgBuff,
- RunCount,
SampleBuffer[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
unsigned int