[Image-SIG] Bug in ImageWin (display.c)

Noboru Uchida noboru.uchida.777 at gmail.com
Thu Oct 30 11:49:23 CET 2008

Excuse my poor English.

Problem: Dib.draw() fails occasionally and raises Overflow Error.

In display.c, Window Handles(HWND) and Device Contexts(HDC) are both
declared as "int".
HWND/HDC arguments are parsed by PyArg_ParseTuple(), using format "i".

"i" converts Python integer to plain C integer, but when the value is
greater than 0x7fffffff, it seems to fail in Overflow Error.

The problem is, HWND/HDC *can* take such values.

I think unsigned integer and Format "I" would fix this problem.

More information about the Image-SIG mailing list