Here is the critical code : ( in avs.c)
pixels=MagickAllocateArray(unsigned char *,image->columns,4); //158
if (pixels == (unsigned char *) NULL)
ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image);
row_bytes=4*image->columns;
for (y=0; y < (long) image->rows; y++)
{
if (ReadBlob(image,row_bytes,pixels) != row_bytes)
{
ThrowException(exception,CorruptImageError,UnexpectedEndOfFile, //166
image->filename);
status=MagickFail;
}
Line 166 do not free memory about pixels, this will cause memory leak.
Credit: ADLab of Venustech
This problem is fixed by Mercurial changeset 15205:d58b78194747. Thanks for the report!