[Scummvm-cvs-logs] CVS: scummvm/scumm script_v6.cpp,1.112,1.113
Max Horn
fingolfin at users.sourceforge.net
Wed May 14 13:15:03 CEST 2003
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/backends/sdl sdl-common.cpp,1.47,1.48 sdl-common.h,1.21,1.22 sdl.cpp,1.30,1.31 sdl_gl.cpp,1.28,1.29
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.82,2.83 script_v2.cpp,2.68,2.69 script_v5.cpp,1.77,1.78 script_v6.cpp,1.113,1.114 script_v8.cpp,2.155,2.156 scumm.h,1.188,1.189
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv16237
Modified Files:
script_v6.cpp
Log Message:
additional readArray protection (might cause regression in FT, but then we should fix FT!)
Index: script_v6.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6.cpp,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -d -r1.112 -r1.113
--- script_v6.cpp 14 May 2003 10:14:05 -0000 1.112
+++ script_v6.cpp 14 May 2003 20:14:03 -0000 1.113
@@ -393,7 +393,7 @@
int Scumm::readArray(int array, int idx, int base) {
ArrayHeader *ah = (ArrayHeader *)getResourceAddress(rtString, readVar(array));
- if (ah == NULL) {
+ if (ah == NULL || ah->data == NULL) {
error("readArray: invalid array %d (%d)", array, readVar(array));
}
@@ -401,7 +401,10 @@
// FIXME: comment this for the time being as it was causing ft to crash
// in the minefeild
- //assert(base >= 0 && base < ah->dim1_size * ah->dim2_size);
+ // FIX THE FIXME: fixing an assert by commenting out is bad. It's evil.
+ // It's wrong. Find the proper cause, or at least, silently return
+ // from the function, but don't just go on overwriting memory!
+ assert(base >= 0 && base < ah->dim1_size * ah->dim2_size);
if (ah->type == 4) {
return ah->data[base];
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/backends/sdl sdl-common.cpp,1.47,1.48 sdl-common.h,1.21,1.22 sdl.cpp,1.30,1.31 sdl_gl.cpp,1.28,1.29
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.82,2.83 script_v2.cpp,2.68,2.69 script_v5.cpp,1.77,1.78 script_v6.cpp,1.113,1.114 script_v8.cpp,2.155,2.156 scumm.h,1.188,1.189
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list