aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2012-03-09 20:44:10 +1100
committerStrangerke2012-04-06 08:22:59 +0200
commit24866fe395ebee1e127e749ee9209f45b98e729d (patch)
tree8d5de9d04a0b55e75993c1b1ce4cff00aff95aed /engines
parent36a65ad3c9c858f72ba62d16d58b6996228b27fa (diff)
downloadscummvm-rg350-24866fe395ebee1e127e749ee9209f45b98e729d.tar.gz
scummvm-rg350-24866fe395ebee1e127e749ee9209f45b98e729d.tar.bz2
scummvm-rg350-24866fe395ebee1e127e749ee9209f45b98e729d.zip
MORTEVIELLE: Fix crash in chartex method for French version
Diffstat (limited to 'engines')
-rw-r--r--engines/mortevielle/ovd1.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp
index cab69c0a07..8641a18501 100644
--- a/engines/mortevielle/ovd1.cpp
+++ b/engines/mortevielle/ovd1.cpp
@@ -105,21 +105,24 @@ void chartex() {
if (!inpFile.open("TXX.INP")) {
if (!inpFile.open("TXX.MOR")) {
warning("Missing file - TXX.INP or .MOR - Switching to DAT file");
+ return;
}
- } else if ((inpFile.size() > (maxti * 2)) || (ntpFile.size() > (maxtd * 3))) {
- warning("TXX file - Unexpected format - Switching to DAT file");
+ }
+ if (!ntpFile.open("TXX.NTP")) {
+ warning("Missing file - TXX.INP or .MOR - Switching to DAT file");
return;
- } else {
- for (int i = 0; i < inpFile.size() / 2; ++i)
- g_t_mot[i] = inpFile.readUint16LE();
-
- inpFile.close();
- g_vm->_txxFileFl = true;
}
+
+ if ((inpFile.size() > (maxti * 2)) || (ntpFile.size() > (maxtd * 3))) {
+ warning("TXX file - Unexpected format - Switching to DAT file");
+ return;
+ }
- if (!ntpFile.open("TXX.NTP")) {
- error("Missing file - TXX.NTP");
- }
+ for (int i = 0; i < inpFile.size() / 2; ++i)
+ g_t_mot[i] = inpFile.readUint16LE();
+
+ inpFile.close();
+ g_vm->_txxFileFl = true;
for (int i = 0; i < (ntpFile.size() / 3); ++i) {
g_t_rec[i]._indis = ntpFile.readSint16LE();