# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1324982858 0 # Node ID 9b26000344739e57f9d75406884143587cfff963 # Parent fbe9028af34199635e4ef7456e52cc97f4b404b1 Safety check in _lookup_icon() on Windows to make sure we don't try to add an invalid icon handle to the image list. diff -r fbe9028af341 -r 9b2600034473 win/dw.c --- a/win/dw.c Tue Dec 27 00:15:51 2011 +0000 +++ b/win/dw.c Tue Dec 27 10:47:38 2011 +0000 @@ -8305,6 +8305,10 @@ int z; static HWND lasthwnd = NULL; + /* We can't add an invalid handle */ + if(!hicon) + return -1; + if(!hSmall || !hLarge) { hSmall = ImageList_Create(16, 16, ILC_COLOR16 | ILC_MASK, ICON_INDEX_LIMIT, 0);