Menu

#480 assertion failure in MagickMapAllocateMap

v1.0_(example)
closed-fixed
None
5
2017-09-30
2017-09-25
bestshow
No

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

Discussion

  • Bob Friesenhahn

    Bob Friesenhahn - 2017-09-30
    • status: open --> closed-fixed
    • assigned_to: Bob Friesenhahn
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2017-09-30

    This problem is fixed by Mercurial changeset 15186:8093cf0b1512. Thanks for the report!

     

Log in to post a comment.

MongoDB Logo MongoDB