x;
for (x=0; fabs(draw_info->dash_pattern[x]) >= MagickEpsilon; x++) ;
- clone_info->dash_pattern=(double *) AcquireQuantumMemory((size_t) x+1UL,
+ clone_info->dash_pattern=(double *) AcquireQuantumMemory((size_t) (x+2),
sizeof(*clone_info->dash_pattern));
if (clone_info->dash_pattern == (double *) NULL)
ThrowFatalException(ResourceLimitFatalError,
"UnableToAllocateDashPattern");
(void) memcpy(clone_info->dash_pattern,draw_info->dash_pattern,(size_t)
- (x+1)*sizeof(*clone_info->dash_pattern));
+ (x+2)*sizeof(*clone_info->dash_pattern));
}
clone_info->gradient=draw_info->gradient;
if (draw_info->gradient.stops != (StopInfo *) NULL)
GetNextToken(r,&r,extent,token);
}
graphic_context[n]->dash_pattern=(double *)
- AcquireQuantumMemory((size_t) (2UL*x+2UL),
+ AcquireQuantumMemory((size_t) (2*x+2),
sizeof(*graphic_context[n]->dash_pattern));
if (graphic_context[n]->dash_pattern == (double *) NULL)
{
break;
}
(void) memset(graphic_context[n]->dash_pattern,0,(size_t)
- (2UL*x+2UL)*sizeof(*graphic_context[n]->dash_pattern));
+ (2*x+2)*sizeof(*graphic_context[n]->dash_pattern));
for (j=0; j < x; j++)
{
GetNextToken(q,&q,extent,token);
size_t
compress_extent,
+ extent,
length,
packet_size;
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
if (q == (Quantum *) NULL)
break;
+ extent=0;
switch (image->compression)
{
#if defined(MAGICKCORE_BZLIB_DELEGATE)
if (code == BZ_STREAM_END)
break;
} while (bzip_info.avail_out != 0);
- (void) ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
+ extent=ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
quantum_type,pixels,exception);
break;
}
if (code == LZMA_STREAM_END)
break;
} while (lzma_info.avail_out != 0);
- (void) ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
+ extent=ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
quantum_type,pixels,exception);
break;
}
if (code == Z_STREAM_END)
break;
} while (zip_info.avail_out != 0);
- (void) ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
+ extent=ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
quantum_type,pixels,exception);
break;
}
SetPixelAlpha(image,ClampToQuantum(pixel.alpha),q);
q+=GetPixelChannels(image);
}
+ extent=(size_t) x;
break;
}
default:
count=ReadBlob(image,packet_size*image->columns,pixels);
if (count != (ssize_t) (packet_size*image->columns))
ThrowMIFFException(CorruptImageError,"UnableToReadImageData");
- (void) ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
+ extent=ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
quantum_type,pixels,exception);
break;
}
}
+ if (extent < image->columns)
+ break;
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
}