[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 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 432ca86..9cdb7e4 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -548,7 +548,7 @@ 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++) {
+        for(s = 0; s <= This->numContexts; s++) {
             if(oldArray[s] == context) continue;
             This->contexts[t] = oldArray[s];
             t++;
-- 
1.5.3.8


--========GMX155031209838997542865--



More information about the wine-patches mailing list