Correct error handling in _XcursorAverageColor
Previously it would either div-zero or get stuck in a loop until int overflow
if called with a bad value.
cursor.c:214:32: warning: Division by zero
return (0xff << 24) | ((red/npixels) << 16) | ((green/npixels) << 8) | (blue/npixels);
Found-by: clang static analyzer
Signed-off-by:
Jeremy Huddleston <jeremyhu@apple.com>
Loading
Please register or sign in to comment