[Scummvm-cvs-logs] scummvm master -> 08be91604900f0d43380b3429a2aef87378c710f

eriktorbjorn eriktorbjorn at telia.com
Tue Jun 4 06:22:31 CEST 2013


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
08be916049 SCUMM: Verify sample width in Digital iMUSE callback. CID 1002112


Commit: 08be91604900f0d43380b3429a2aef87378c710f
    https://github.com/scummvm/scummvm/commit/08be91604900f0d43380b3429a2aef87378c710f
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2013-06-03T21:11:41-07:00

Commit Message:
SCUMM: Verify sample width in Digital iMUSE callback. CID 1002112

Verify that 'bits' really is one of 8, 12 or 16 before decoding
the data. It's probably always the case (unless the data files are
damaged) but if it isn't we'll either try to queue NULL to the
audio stream, or queue the same buffer more than once, or free the
buffer more than once. All of which are bad, though Coverity only
noticed the last of these cases.

Changed paths:
    engines/scumm/imuse_digi/dimuse.cpp



diff --git a/engines/scumm/imuse_digi/dimuse.cpp b/engines/scumm/imuse_digi/dimuse.cpp
index eb37174..a737539 100644
--- a/engines/scumm/imuse_digi/dimuse.cpp
+++ b/engines/scumm/imuse_digi/dimuse.cpp
@@ -275,9 +275,12 @@ void IMuseDigital::callback() {
 						feedSize &= ~1;
 					if (channels == 2)
 						feedSize &= ~3;
-				} else {
+				} else if (bits == 8) {
 					if (channels == 2)
 						feedSize &= ~1;
+				} else {
+					warning("IMuseDigita::callback: Unexpected sample width, %d bits", bits);
+					continue;
 				}
 
 				if (feedSize == 0)






More information about the Scummvm-git-logs mailing list