assertion failure in MagickMapAllocateMap
Swiss army knife of image processing
Brought to you by:
bfriesen
Here is the critical code: (in MagickMapCopyBlob)
MagickMapCopyBlob(const void *blob, const size_t size)
{
if (blob)
{
void
*memory;
memory=MagickAllocateMemory(void *,size); //1144
if (memory)
(void) memcpy(memory,blob,size);
return (memory);
}
return 0;
}
MagickAllocateMemory(...) may return NULL, and return the value "memory" to the caller SetImageProfile:
image->profiles=MagickMapAllocateMap(MagickMapCopyBlob, //1251
MagickMapDeallocateBlob);
(void) LogMagickEvent(TransformEvent,GetMagickModule(),
"Adding %s profile with length %ld bytes",name,
(unsigned long) length);
if (profile != 0)
{
status &= MagickMapAddEntry(image->profiles,name,profile,length,
&image->exception);
}
And in the MagickMapAllocateMap:
MagickExport MagickMap
MagickMapAllocateMap(MagickMapObjectClone clone, //442
MagickMapObjectDeallocator deallocate)
{
MagickMap
map;
assert(clone != 0);
assert(deallocate != 0);
If the “clone" is NULL,the assertion “assert(clone != 0)" will failed.
Credit : ADLab of Venustech
This problem is fixed by Mercurial changeset 15186:8093cf0b1512. Thanks for the report!