[PATCH] At the start of RemoveContextFromArray numContexts is decreased by 1, the loop which loops through the whole array doesn't take this into account. Fix this by using '<=' instead of '<'. This bug was discovered by Peter Oberndorfer. I needed it myself to fix bug 12914.
Roderick Colenbrander
thunderbird2k at gmx.net
Sat May 3 15:15:58 CDT 2008
---
dlls/wined3d/context.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 432ca86..14d8fce 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -548,7 +548,8 @@ static void RemoveContextFromArray(IWineD3DDeviceImpl *This, WineD3DContext *con
ERR("Cannot allocate a new context array, PANIC!!!\n");
}
t = 0;
- for(s = 0; s < This->numContexts; s++) {
+ /* Note that we decreased numContexts a few lines up, so use '<=' instead of '<' */
+ for(s = 0; s <= This->numContexts; s++) {
if(oldArray[s] == context) continue;
This->contexts[t] = oldArray[s];
t++;
--
1.5.3.8
--========GMX155071209840251162536--
More information about the wine-patches
mailing list