[Scummvm-cvs-logs] scummvm master -> 1fdeb98e70d606c9e6c8a012d26062c1cd859524

clone2727 clone2727 at gmail.com
Wed Sep 16 02:49:27 CEST 2015


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

Summary:
8165e9aa4c AUDIO: Fix uninitialized read in MP3 initialization
1fdeb98e70 AUDIO: Fix compiler warning


Commit: 8165e9aa4c32802bba5e07570c033f966cf2dc50
    https://github.com/scummvm/scummvm/commit/8165e9aa4c32802bba5e07570c033f966cf2dc50
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2015-09-15T20:44:09-04:00

Commit Message:
AUDIO: Fix uninitialized read in MP3 initialization

Thanks to chkr-private for finding the issue

Changed paths:
    audio/decoders/mp3.cpp



diff --git a/audio/decoders/mp3.cpp b/audio/decoders/mp3.cpp
index 49d4d85..36233a2 100644
--- a/audio/decoders/mp3.cpp
+++ b/audio/decoders/mp3.cpp
@@ -330,8 +330,11 @@ MP3Stream::MP3Stream(Common::SeekableReadStream *inStream, DisposeAfterUse::Flag
 		_inStream(skipID3(inStream, dispose)),
 		_length(0, 1000) {
 
-	// Initialize the stream with some data
+	// Initialize the stream with some data and set the channels and rate
+	// variables
 	decodeMP3Data(*_inStream);
+	_channels = MAD_NCHANNELS(&_frame.header);
+	_rate = _frame.header.samplerate;
 
 	// Calculate the length of the stream
 	while (_state != MP3_STATE_EOS)
@@ -352,12 +355,8 @@ MP3Stream::MP3Stream(Common::SeekableReadStream *inStream, DisposeAfterUse::Flag
 	_state = MP3_STATE_INIT;
 	_inStream->seek(0);
 
-	// Decode the first chunk of data. This is necessary so that _frame
-	// is setup and we can retrieve channels/rate.
+	// Decode the first chunk of data to set up the stream again.
 	decodeMP3Data(*_inStream);
-
-	_channels = MAD_NCHANNELS(&_frame.header);
-	_rate = _frame.header.samplerate;
 }
 
 int MP3Stream::readBuffer(int16 *buffer, const int numSamples) {


Commit: 1fdeb98e70d606c9e6c8a012d26062c1cd859524
    https://github.com/scummvm/scummvm/commit/1fdeb98e70d606c9e6c8a012d26062c1cd859524
Author: Christian Krause (chkr at plauener.de)
Date: 2015-09-15T20:48:09-04:00

Commit Message:
AUDIO: Fix compiler warning

This commit fixes a compiler warning about a "set but not used"
variable. The warning was introduced by commit 2f707bf2.

Changed paths:
    audio/decoders/aiff.cpp



diff --git a/audio/decoders/aiff.cpp b/audio/decoders/aiff.cpp
index 72baf84..e1949eb 100644
--- a/audio/decoders/aiff.cpp
+++ b/audio/decoders/aiff.cpp
@@ -102,7 +102,7 @@ RewindableAudioStream *makeAIFFStream(Common::SeekableReadStream *stream, Dispos
 	bool foundSSND = false;
 
 	uint16 channels = 0, bitsPerSample = 0;
-	uint32 blockAlign = 0, rate = 0;
+	uint32 rate = 0;
 	uint32 codec = kCodecPCM; // AIFF default
 	Common::SeekableReadStream *dataStream = 0;
 
@@ -128,7 +128,7 @@ RewindableAudioStream *makeAIFFStream(Common::SeekableReadStream *stream, Dispos
 		case MKTAG('S', 'S', 'N', 'D'):
 			foundSSND = true;
 			/* uint32 offset = */ stream->readUint32BE();
-			blockAlign = stream->readUint32BE();
+			/* uint32 blockAlign = */ stream->readUint32BE();
 			dataStream = new Common::SeekableSubReadStream(stream, stream->pos(), stream->pos() + length - 8, disposeAfterUse);
 			break;
 		case MKTAG('F', 'V', 'E', 'R'):






More information about the Scummvm-git-logs mailing list