listview
Ulrich Czekalla
ulrich.czekalla at utoronto.ca
Mon May 10 23:40:38 CDT 2004
This patch prevents a crash in the listview control.
ChangeLog:
Ulrich Czekalla <ulrich at codeweavers.com>
Handle case where iterator range contains 0 elements
-------------- next part --------------
Index: dlls/comctl32/listview.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/listview.c,v
retrieving revision 1.387
diff -u -w -r1.387 listview.c
--- dlls/comctl32/listview.c 21 Apr 2004 22:25:04 -0000 1.387
+++ dlls/comctl32/listview.c 11 May 2004 04:34:02 -0000
@@ -1109,12 +1109,16 @@
static RANGE iterator_range(ITERATOR* i)
{
- RANGE range;
+ RANGE range = { 0, 0 };
if (!i->ranges) return i->range;
+ if (DPA_GetPtrCount(i->ranges->hdpa) > 0)
+ {
range.lower = (*(RANGE*)DPA_GetPtr(i->ranges->hdpa, 0)).lower;
range.upper = (*(RANGE*)DPA_GetPtr(i->ranges->hdpa, DPA_GetPtrCount(i->ranges->hdpa) - 1)).upper;
+ }
+
return range;
}
More information about the wine-patches
mailing list