From 94c58f9143a45bbbae74260633f6ca1be6b10597 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Mon, 23 May 2016 19:22:09 +0200 Subject: GNAP: Add safeguard in setSoundVolume --- engines/gnap/sound.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/gnap/sound.cpp') diff --git a/engines/gnap/sound.cpp b/engines/gnap/sound.cpp index a4a59d7390..75cfb5555c 100644 --- a/engines/gnap/sound.cpp +++ b/engines/gnap/sound.cpp @@ -57,6 +57,9 @@ void SoundMan::stopSound(int resourceId) { } void SoundMan::setSoundVolume(int resourceId, int volume) { + if (resourceId == -1 || volume < 0 || volume > 100) + return; + const int index = find(resourceId); int realVol = volume * 2.55; _vm->_mixer->setChannelVolume(_items[index]._handle, realVol); -- cgit v1.2.3