aboutsummaryrefslogtreecommitdiff
path: root/windows.cpp
diff options
context:
space:
mode:
authorLudvig Strigeus2001-11-06 07:47:01 +0000
committerLudvig Strigeus2001-11-06 07:47:01 +0000
commit65fc6958d7fbd6af1720d2156951e79e89d67d1a (patch)
treef8cd5152d2fd5ad7a08ad3420d1a512f1ef7d230 /windows.cpp
parente2f1fef1f92b1646cf9faa2eb23a47f393b245da (diff)
downloadscummvm-rg350-65fc6958d7fbd6af1720d2156951e79e89d67d1a.tar.gz
scummvm-rg350-65fc6958d7fbd6af1720d2156951e79e89d67d1a.tar.bz2
scummvm-rg350-65fc6958d7fbd6af1720d2156951e79e89d67d1a.zip
fixed integer overflow for large sounds
svn-id: r3458
Diffstat (limited to 'windows.cpp')
-rw-r--r--windows.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/windows.cpp b/windows.cpp
index a0edf79cda..c0505968c7 100644
--- a/windows.cpp
+++ b/windows.cpp
@@ -17,6 +17,9 @@
*
* Change Log:
* $Log$
+ * Revision 1.11 2001/11/06 07:47:00 strigeus
+ * fixed integer overflow for large sounds
+ *
* Revision 1.10 2001/11/05 20:44:34 strigeus
* speech support
*
@@ -873,7 +876,7 @@ void playSfxSound(void *sound, uint32 size, uint rate) {
_sfx_pos = 0;
_sfx_fp_speed = (1<<16) * rate / 22050;
_sfx_fp_pos = 0;
- debug(1, "size=%d, rate=%d", size, rate);
+ while (size&0xFFFF0000) size>>=1, rate>>=1;
_sfx_size = size * 22050 / rate;
}