aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2009-01-24 19:19:24 +0000
committerWillem Jan Palenstijn2009-01-24 19:19:24 +0000
commit3c79c6229ca52d6e0ddd787861bdf4662a8dd1be (patch)
treeba97b013887695dee819b4223a64f4bd3ef8d408 /engines
parentae60d362c85a7cac0360904e97f95fcd154d80dd (diff)
downloadscummvm-rg350-3c79c6229ca52d6e0ddd787861bdf4662a8dd1be.tar.gz
scummvm-rg350-3c79c6229ca52d6e0ddd787861bdf4662a8dd1be.tar.bz2
scummvm-rg350-3c79c6229ca52d6e0ddd787861bdf4662a8dd1be.zip
fix near-infinite loop and segfault in ARM costume asm when len == 0 (should fix #2340221)
svn-id: r36039
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/proc3ARM.s3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/scumm/proc3ARM.s b/engines/scumm/proc3ARM.s
index cefe37153e..e3c20cc05c 100644
--- a/engines/scumm/proc3ARM.s
+++ b/engines/scumm/proc3ARM.s
@@ -198,7 +198,8 @@ middleloop:
@ r14= len
MOV r5,r12 @ loopCount = height
- CMP r5,r14 @ if (loopCount > len)
+ CMP r14,#0
+ CMPNE r5,r14 @ if (len != 0 && loopCount > len)
MOVGT r5,r14 @ loopCount = len
SUB r12,r12,r5 @ height -= loopCount
SUB r14,r14,r5 @ len -= loopCount