Bug 745272: Replace comparison of unsigned value >=0 with a useful comparison. r=humph r=cpearce

This commit is contained in:
Daniel Holbert 2012-04-16 14:29:14 -07:00
Родитель bd3ef287ae
Коммит 84e3e8e7cf
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -165,6 +165,9 @@ void nsAudioAvailableEventManager::QueueWrittenAudioData(AudioDataValue* aAudioD
signalBuffer[i] = MOZ_CONVERT_AUDIO_SAMPLE(audioData[i]); signalBuffer[i] = MOZ_CONVERT_AUDIO_SAMPLE(audioData[i]);
} }
audioData += signalBufferTail; audioData += signalBufferTail;
NS_ASSERTION(audioDataLength >= signalBufferTail,
"audioDataLength about to wrap past zero to +infinity!");
audioDataLength -= signalBufferTail; audioDataLength -= signalBufferTail;
if (mPendingEvents.Length() > 0) { if (mPendingEvents.Length() > 0) {
@ -192,7 +195,6 @@ void nsAudioAvailableEventManager::QueueWrittenAudioData(AudioDataValue* aAudioD
mSignalBuffer = new float[currentBufferSize]; mSignalBuffer = new float[currentBufferSize];
mSignalBufferPosition = 0; mSignalBufferPosition = 0;
signalBufferTail = currentBufferSize; signalBufferTail = currentBufferSize;
NS_ASSERTION(audioDataLength >= 0, "Past new signal data length.");
} }
NS_ASSERTION(mSignalBufferPosition + audioDataLength < mSignalBufferLength, NS_ASSERTION(mSignalBufferPosition + audioDataLength < mSignalBufferLength,