aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Fach-Pedersen2016-10-24 19:36:40 +0200
committerThomas Fach-Pedersen2016-10-24 19:40:18 +0200
commit125f69999751210f912a25c509191114c7381c60 (patch)
tree6196399fc3f1276f94fdd004ed3565412d5d9a68
parent8045edab27488ba3cc849be613afe893cb4317e5 (diff)
downloadscummvm-rg350-125f69999751210f912a25c509191114c7381c60.tar.gz
scummvm-rg350-125f69999751210f912a25c509191114c7381c60.tar.bz2
scummvm-rg350-125f69999751210f912a25c509191114c7381c60.zip
BLADERUNNER: Fix potential buffer overrun (CID 1364276)
-rw-r--r--engines/bladerunner/ambient_sounds.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/engines/bladerunner/ambient_sounds.cpp b/engines/bladerunner/ambient_sounds.cpp
index c33deefb80..aaf6c016d3 100644
--- a/engines/bladerunner/ambient_sounds.cpp
+++ b/engines/bladerunner/ambient_sounds.cpp
@@ -185,6 +185,10 @@ void AmbientSounds::addSoundByName(
int pan1begin, int pan1end,
int pan2begin, int pan2end,
int priority, int unk3) {
+ if (strlen(name) > 12) {
+ error("AmbientSounds::addSoundByName: Overlong name '%s'", name);
+ }
+
int i = findAvailableNonLoopingTrack();
if (i < 0)
return;