Here is the critical code : (in ReadPCDImage)
number_pixels=image->columns*image->rows; //619
chroma1=MagickAllocateMemory(unsigned char *,number_pixels+1);
chroma2=MagickAllocateMemory(unsigned char *,number_pixels+1);
luma=MagickAllocateMemory(unsigned char *,number_pixels+1);
if ((chroma1 == (unsigned char *) NULL) ||
(chroma2 == (unsigned char *) NULL) || (luma == (unsigned char *) NULL))
ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image);
If one of the “chroma1”,”chroma2”,”luma” is NULL at least,and others are not,this may cause memory leak。
Credit : ADLab of Venustech
This problem is fixed by Mercurial changeset 15199:755359b1a5ac. Thanks for the report!