diff options
author | Walter van Niftrik | 2018-01-27 23:12:10 +0100 |
---|---|---|
committer | Walter van Niftrik | 2018-02-02 22:18:25 +0100 |
commit | 9f479c9b17b9268eafacfdf925c83ba89d92ef10 (patch) | |
tree | 7ad0e077e441d8d6e946ec487a52ba9b16a47dd2 | |
parent | b64d8dbf3be1c58cd07a0f57e2088d496db926bb (diff) | |
download | scummvm-rg350-9f479c9b17b9268eafacfdf925c83ba89d92ef10.tar.gz scummvm-rg350-9f479c9b17b9268eafacfdf925c83ba89d92ef10.tar.bz2 scummvm-rg350-9f479c9b17b9268eafacfdf925c83ba89d92ef10.zip |
ADL: Add sanity check to track/sector numbers read from NIB
-rw-r--r-- | engines/adl/disk.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/engines/adl/disk.cpp b/engines/adl/disk.cpp index 6174f6ff43..a77798c1b6 100644 --- a/engines/adl/disk.cpp +++ b/engines/adl/disk.cpp @@ -150,6 +150,12 @@ static Common::SeekableReadStream *readImage_NIB(const Common::String &filename, continue; } + if (track >= 35 || sector >= sectorsPerTrack) { + warning("NIB: sector out of bounds @ (%x, %x)", track, sector); + sawAddress = false; + continue; + } + if (!firstGoodTrackPos) firstGoodTrackPos = pos; |