In ImageMagick 7.x before 7.0.8-41 and 6.x before 6.9.10-41, there is a divide-by-zero vulnerability in the MeanShiftImage function. It allows an attacker to cause a denial of service by sending a crafted file.
MagickCore/feature.c

In line 2259, it assgin 'count=0', the code make a loop as 'for (v=(-((ssize_t) height/2)); v <= (((ssize_t) height/2)); v++)'  ,  the 'count++' in this loop and the 'gamma=1.0/count' in line 2291. But the count is 0 in some cases. It may happen DIVIDE_BY_ZERO bug if the code don't get in this loop.


DIVIDE_BY_ZERO in feature.c
This is a GitHub Issue
repo:ImageMagick
owner:ImageMagick
Title : DIVIDE_BY_ZERO in feature.c
Issue date:

--- start body ---
MagickCore/feature.c

In line 2259, it assgin 'count=0', the code make a loop as 'for (v=(-((ssize_t) height/2)); v <= (((ssize_t) height/2)); v++)'  ,  the 'count++' in this loop and the 'gamma=1.0/count' in line 2291. But the count is 0 in some cases. It may happen DIVIDE_BY_ZERO bug if the code don't get in this loop.


--- end body ---
