if (blob_info->mapped != MagickFalse)
{
(void) UnmapBlob(blob_info->data,blob_info->length);
+ blob_info->data=(unsigned char *) NULL;
RelinquishMagickResource(MapResource,blob_info->length);
}
blob_info->mapped=MagickFalse;
blob=(unsigned char *) AcquireQuantumMemory(quantum,sizeof(*blob));
if (blob == (unsigned char *) NULL)
{
+ file=close(file);
ThrowFileException(exception,ResourceLimitError,"MemoryAllocationFailed",
filename);
return(MagickFalse);
buffer=(unsigned char *) RelinquishMagickMemory(buffer);
if ((file == -1) || (i < length))
{
+ if (file == -1)
+ file=close(file);
ThrowFileException(exception,BlobError,"UnableToWriteBlob",filename);
return(MagickFalse);
}
result->ai_protocol);
if (client_socket == -1)
{
+ (void) close(client_socket);
(void) ThrowMagickException(exception,GetMagickModule(),CacheError,
"DistributedPixelCache","'%s'",hostname);
return(-1);
status=setsockopt(server_socket,SOL_SOCKET,SO_REUSEADDR,&one,(socklen_t)
sizeof(one));
if (status == -1)
- continue;
+ {
+ (void) close(status);
+ continue;
+ }
status=bind(server_socket,p->ai_addr,p->ai_addrlen);
if (status == -1)
{
changed; /* number pixels changed by last primitive operation */
char
- v_info[80];
+ v_info[MaxTextExtent];
assert(image != (Image *) NULL);
assert(image->signature == MagickSignature);
WandExport char *PixelGetColorAsNormalizedString(const PixelWand *wand)
{
char
- color[MaxTextExtent];
+ color[2*MaxTextExtent];
assert(wand != (const PixelWand *) NULL);
assert(wand->signature == WandSignature);
{
char
filename[MaxTextExtent],
- header[129],
+ header[MaxTextExtent],
message[MaxTextExtent];
FILE
cin.origination.model);
(void) SetImageProperty(image,"dpx:origination.model",cin.origination.model,
exception);
+ (void) ResetMagickMemory(cin.origination.serial,0,
+ sizeof(cin.origination.serial));
offset+=ReadBlob(image,sizeof(cin.origination.serial),(unsigned char *)
cin.origination.serial);
(void) SetImageProperty(image,"dpx:origination.serial",
if (tag == 0xFFFEE0DD)
break; /* sequence delimiter tag */
if (tag != 0xFFFEE000)
- ThrowReaderException(CorruptImageError,"ImproperImageHeader");
+ {
+ (void) fclose(file);
+ ThrowReaderException(CorruptImageError,"ImproperImageHeader");
+ }
for ( ; length != 0; length--)
{
c=ReadBlobByte(image);
gridrcp.z = 1.0f/31.0f;
gridrcp.w = 0.0f;
+ xSumwSum.x = 0.0f;
+ xSumwSum.y = 0.0f;
+ xSumwSum.z = 0.0f;
+ xSumwSum.w = 0.0f;
+
ConstructOrdering(count,points,principle,pointsWeights,&xSumwSum,order,0);
for (iterationIndex = 0;;)
static void WriteDDSInfo(Image *image, const size_t pixelFormat,
const size_t compression, const size_t mipmaps)
{
+ char
+ software[MaxTextExtent];
+
register ssize_t
i;
(void) WriteBlobLSBLong(image,0x00);
(void) WriteBlobLSBLong(image,(unsigned int) mipmaps+1);
- (void) WriteBlob(image,44,(unsigned char *) "IMAGEMAGICK");
+ (void) ResetMagickMemory(software,0,sizeof(software));
+ (void) strcpy(software,"IMAGEMAGICK");
+ (void) WriteBlob(image,44,(unsigned char *) software);
(void) WriteBlobLSBLong(image,32);
(void) WriteBlobLSBLong(image,format);
keyword[i]=tolower((int) ((unsigned char) keyword[i]));
}
keyword[i]='\0';
+ (void) ResetMagickMemory(value,0,sizeof(value));
count=ReadBlob(image,72,(unsigned char *) value);
if (count != 72)
break;
- value[72]='\0';
p=value;
if (*p == '=')
{
}
else
{
- count=WriteBlob(image,4*image->columns*sizeof(*pixel),pixel);
- if (count != (ssize_t) (4*image->columns*sizeof(*pixel)))
+ count=WriteBlob(image,4*image->columns*sizeof(*pixels),pixels);
+ if (count != (ssize_t) (4*image->columns*sizeof(*pixels)))
break;
}
status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y,
(void) memcpy(&local_time,localtime(¤t_time),sizeof(local_time));
#endif
(void) memset(MATLAB_HDR,' ',MagickMin(sizeof(MATLAB_HDR),124));
- FormatLocaleString(MATLAB_HDR,MaxTextExtent,"MATLAB 5.0 MAT-file, Platform: %s, Created on: %s %s %2d %2d:%2d:%2d %d",
+ FormatLocaleString(MATLAB_HDR,sizeof(MATLAB_HDR),
+ "MATLAB 5.0 MAT-file, Platform: %s, Created on: %s %s %2d %2d:%2d:%2d %d",
OsDesc,DayOfWTab[local_time.tm_wday],MonthsTab[local_time.tm_mon],
local_time.tm_mday,local_time.tm_hour,local_time.tm_min,
local_time.tm_sec,local_time.tm_year+1900);
(void) fputc(c,file);
}
(void) fclose(file);
+ (void) close(unique_file);
tile_image=ReadImage(read_info,exception);
(void) RelinquishUniqueFileResource(read_info->filename);
read_info=DestroyImageInfo(read_info);
if (status == MagickFalse)
break;
}
+ (void) close(unique_file);
(void) RelinquishUniqueFileResource(read_info->filename);
read_info=DestroyImageInfo(read_info);
(void) CloseBlob(pwp_image);
count=ReadBlob(image,24,(unsigned char *) rla_info.white_point);
rla_info.job_number=(int) ReadBlobMSBLong(image);
count=ReadBlob(image,128,(unsigned char *) rla_info.name);
+ (void) ResetMagickMemory(value,0,sizeof(rla_info.description));
count=ReadBlob(image,128,(unsigned char *) rla_info.description);
count=ReadBlob(image,64,(unsigned char *) rla_info.program);
count=ReadBlob(image,32,(unsigned char *) rla_info.machine);
extent=fwrite(offset+1,(size_t) (data-offset),1,file);
status=ferror(file) == -1 ? MagickFalse : MagickTrue;
(void) fclose(file);
+ (void) close(unique_file);
buffer=(unsigned char *) RelinquishMagickMemory(buffer);
if (status == MagickFalse)
{
return((Image *) NULL);
svg_info=AcquireSVGInfo();
if (svg_info == (SVGInfo *) NULL)
- ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ {
+ (void) fclose(file);
+ ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ }
svg_info->file=file;
svg_info->exception=exception;
svg_info->image=image;