[Scummvm-cvs-logs] SF.net SVN: scummvm:[44084] scummvm/trunk/engines/groovie/music.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Mon Sep 14 20:40:05 CEST 2009


Revision: 44084
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44084&view=rev
Author:   lordhoto
Date:     2009-09-14 18:40:05 +0000 (Mon, 14 Sep 2009)

Log Message:
-----------
Fix valgrind warning.

Modified Paths:
--------------
    scummvm/trunk/engines/groovie/music.cpp

Modified: scummvm/trunk/engines/groovie/music.cpp
===================================================================
--- scummvm/trunk/engines/groovie/music.cpp	2009-09-14 13:27:09 UTC (rev 44083)
+++ scummvm/trunk/engines/groovie/music.cpp	2009-09-14 18:40:05 UTC (rev 44084)
@@ -557,7 +557,14 @@
 	}
 
 	// Prepare the AdLib Instrument array from the GTL entry
-	byte data[13];
+	//
+	// struct AdlibInstrument used by our AdLib MIDI synth is 30 bytes,
+	// since we pass data + 2 for non precussion instruments we need to
+	// have a buffer of size 32, so there are no invalid memory reads,
+	// when setting up an AdLib instrument.
+	byte data[32];
+	memset(data, 0, sizeof(data));
+
 	data[2] = timbre.data[1];        // mod_characteristic
 	data[3] = timbre.data[2] ^ 0x3F; // mod_scalingOutputLevel
 	data[4] = ~timbre.data[3];       // mod_attackDecay


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list