[Scummvm-cvs-logs] scummvm master -> 7624cc382210d364dbcf3fab2c782d5cd0b121a3

Strangerke Strangerke at scummvm.org
Mon Sep 12 23:11:19 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
7624cc3822 CGE: Fix crash when newRandom is called with a range set to 0


Commit: 7624cc382210d364dbcf3fab2c782d5cd0b121a3
    https://github.com/scummvm/scummvm/commit/7624cc382210d364dbcf3fab2c782d5cd0b121a3
Author: Strangerke (strangerke at scummvm.org)
Date: 2011-09-12T14:06:14-07:00

Commit Message:
CGE: Fix crash when newRandom is called with a range set to 0

Changed paths:
    engines/cge/general.cpp



diff --git a/engines/cge/general.cpp b/engines/cge/general.cpp
index 3f4377a..dd375f5 100644
--- a/engines/cge/general.cpp
+++ b/engines/cge/general.cpp
@@ -82,6 +82,9 @@ int takeEnum(const char **tab, const char *text) {
 }
 
 int newRandom(int range) {
+	if (!range)
+		return 0;
+
 	return ((CGEEngine *)g_engine)->_randomSource.getRandomNumber(range - 1);
 }
 






More information about the Scummvm-git-logs mailing list