aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTorbjörn Andersson2017-08-06 12:00:32 +0200
committerTorbjörn Andersson2017-08-06 12:00:32 +0200
commit4fb0d1e56f83ac7d5edd06b6d5a2e8019bbddf37 (patch)
treece75ce709c6817040f5f299be206c9a955599cbb /engines
parentb4c1e86d9f8f51e67a2086301fab30a415b04581 (diff)
downloadscummvm-rg350-4fb0d1e56f83ac7d5edd06b6d5a2e8019bbddf37.tar.gz
scummvm-rg350-4fb0d1e56f83ac7d5edd06b6d5a2e8019bbddf37.tar.bz2
scummvm-rg350-4fb0d1e56f83ac7d5edd06b6d5a2e8019bbddf37.zip
JANITORIAL: Increase buffer size to fix potential overflow
Caught by GCC 7 (though the warning seemed misleading to me). Since SoundDesc->name can potentially be 14 characters "%s_reg%03d.fla" can be 25 characters, plus the terminating \0.
Diffstat (limited to 'engines')
-rw-r--r--engines/scumm/imuse_digi/dimuse_sndmgr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/scumm/imuse_digi/dimuse_sndmgr.cpp b/engines/scumm/imuse_digi/dimuse_sndmgr.cpp
index b2ff3aadbb..618d7098a8 100644
--- a/engines/scumm/imuse_digi/dimuse_sndmgr.cpp
+++ b/engines/scumm/imuse_digi/dimuse_sndmgr.cpp
@@ -662,7 +662,7 @@ int32 ImuseDigiSndMgr::getDataFromRegion(SoundDesc *soundDesc, int region, byte
} else if ((soundDesc->bundle) && (soundDesc->compressed)) {
*buf = (byte *)malloc(size);
assert(*buf);
- char fileName[24];
+ char fileName[26];
int offsetMs = (((offset * 8 * 10) / soundDesc->bits) / (soundDesc->channels * soundDesc->freq)) * 100;
sprintf(fileName, "%s_reg%03d", soundDesc->name, region);
if (scumm_stricmp(fileName, soundDesc->lastFileName) != 0) {