From 015565677c743fdbe00df5d114e7d3aa3d90e485 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 1 Jan 2012 21:17:45 +1100 Subject: [PATCH] MORTEVIELLE: Bugfix for loading data in chartex() --- engines/mortevielle/ovd1.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/engines/mortevielle/ovd1.cpp b/engines/mortevielle/ovd1.cpp index 3c532d0f226..99b2e28df1a 100644 --- a/engines/mortevielle/ovd1.cpp +++ b/engines/mortevielle/ovd1.cpp @@ -199,19 +199,22 @@ void ani50() { if (!f.open("TXX.INP")) error("Missing file - TXX.INP"); - for (int i = 0; i < 125; ++i) + assert(f.size() <= (maxti * 2)); + for (i = 0; i < f.size() / 2; ++i) t_mot[i] = f.readSint16LE(); f.close(); if (!f.open("TXX.NTP")) error("Missing file - TXX.NTP"); - do { + + assert(f.size() <= (maxtd * 4)); + for (i = 0; i < (f.size() + 3) / 4; ++i) { t_rec[i].indis = f.readSint16LE(); t_rec[i].point = f.readByte(); + f.readByte(); + } - i = i + 1; - } while (!f.eos()); f.close(); deline(578, s, i);