Skip to content
Commit 047993c7 authored by Jeremy Huddleston's avatar Jeremy Huddleston
Browse files

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: default avatarJeremy Huddleston <jeremyhu@apple.com>
parent bee68e54
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment