Alexander Dorofeyev : ddraw: Fix executebuffer branching with non-zero offset.
Alexandre Julliard
julliard at winehq.org
Tue Feb 19 08:05:13 CST 2008
Module: wine
Branch: master
Commit: 4981eda8951a5bbe0d4b6aea7777078903c05f06
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4981eda8951a5bbe0d4b6aea7777078903c05f06
Author: Alexander Dorofeyev <alexd4 at inbox.lv>
Date: Sun Feb 17 17:36:35 2008 -0800
ddraw: Fix executebuffer branching with non-zero offset.
Fixes a crash in Moto Racer 2.
---
dlls/ddraw/executebuffer.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/ddraw/executebuffer.c b/dlls/ddraw/executebuffer.c
index 49b6d6c..fce3c4f 100644
--- a/dlls/ddraw/executebuffer.c
+++ b/dlls/ddraw/executebuffer.c
@@ -524,12 +524,18 @@ IDirect3DExecuteBufferImpl_Execute(IDirect3DExecuteBufferImpl *This,
if ((This->data.dsStatus.dwStatus & ci->dwMask) == ci->dwValue) {
if (!ci->bNegate) {
TRACE(" Branch to %d\n", ci->dwOffset);
- instr = (char*)current + ci->dwOffset;
+ if (ci->dwOffset) {
+ instr = (char*)current + ci->dwOffset;
+ break;
+ }
}
} else {
if (ci->bNegate) {
TRACE(" Branch to %d\n", ci->dwOffset);
- instr = (char*)current + ci->dwOffset;
+ if (ci->dwOffset) {
+ instr = (char*)current + ci->dwOffset;
+ break;
+ }
}
}
More information about the wine-cvs
mailing list