wined3d: At the start of RemoveContextFromArray numContexts is decreased by 1, the loop which loops through the whole array doesn't take this into account.
Discovered by Peter Oberndorfer.
This commit is contained in:
parent
ed67a1f350
commit
e3b662bb20
|
@ -546,7 +546,8 @@ static void RemoveContextFromArray(IWineD3DDeviceImpl *This, WineD3DContext *con
|
||||||
ERR("Cannot allocate a new context array, PANIC!!!\n");
|
ERR("Cannot allocate a new context array, PANIC!!!\n");
|
||||||
}
|
}
|
||||||
t = 0;
|
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;
|
if(oldArray[s] == context) continue;
|
||||||
This->contexts[t] = oldArray[s];
|
This->contexts[t] = oldArray[s];
|
||||||
t++;
|
t++;
|
||||||
|
|
Loading…
Reference in New Issue