Menu

#492 memory leak in WriteHISTOGRAMImage

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

Here is the critical code : (in WriteHISTOGRAMImage)

  length=Max(ScaleQuantumToChar(MaxRGB)+1,histogram_image->columns);
  red=MagickAllocateMemory(long *,length*sizeof(long)); //225
  green=MagickAllocateMemory(long *,length*sizeof(long));
  blue=MagickAllocateMemory(long *,length*sizeof(long));
  if ((red == (long *) NULL) || (green == (long *) NULL) ||
      (blue == (long *) NULL))
    {
      DestroyImage(histogram_image);
      ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image)
    }

If one of the “red”,”green” and ”blue” is NULL at least,and others are not,this may cause memory leak
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 15198:9e6afa7ba7b9. Thanks for the report!

     

Log in to post a comment.

MongoDB Logo MongoDB