[Scummvm-cvs-logs] CVS: scummvm/sky sound.cpp,1.55,1.56

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Mon Sep 12 00:02:11 CEST 2005


Update of /cvsroot/scummvm/scummvm/sky
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13287

Modified Files:
	sound.cpp 
Log Message:
Avoid integer overflow in volume parameter to playRaw(). This fixes bug
#1288081, the "missing" sound effects in the floppy intro.


Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/sound.cpp,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- sound.cpp	8 Sep 2005 14:08:04 -0000	1.55
+++ sound.cpp	12 Sep 2005 07:01:46 -0000	1.56
@@ -1094,6 +1094,8 @@
 	}
 
 	volume = ((volume & 0x7F) + 1) << 1;
+	if (volume > 255)
+		volume = 255;
 	sound &= 0xFF;
 
 	// note: all those tables are big endian. Don't ask me why. *sigh*





More information about the Scummvm-git-logs mailing list