mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-11 01:57:00 +00:00
Bug 1033066: Never let AudioSegments underflow mDuration and cause OOM allocation r=karlt
This commit is contained in:
parent
fabb054089
commit
012b38099a
@ -154,7 +154,8 @@ AudioSegment::WriteTo(uint64_t aID, AudioMixer& aMixer, uint32_t aOutputChannels
|
||||
// Offset in the buffer that will end up sent to the AudioStream, in samples.
|
||||
uint32_t offset = 0;
|
||||
|
||||
if (!GetDuration()) {
|
||||
if (GetDuration() <= 0) {
|
||||
MOZ_ASSERT(GetDuration() == 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -86,8 +86,8 @@ struct AudioChunk {
|
||||
// Generic methods
|
||||
void SliceTo(TrackTicks aStart, TrackTicks aEnd)
|
||||
{
|
||||
NS_ASSERTION(aStart >= 0 && aStart < aEnd && aEnd <= mDuration,
|
||||
"Slice out of bounds");
|
||||
MOZ_ASSERT(aStart >= 0 && aStart < aEnd && aEnd <= mDuration,
|
||||
"Slice out of bounds");
|
||||
if (mBuffer) {
|
||||
MOZ_ASSERT(aStart < INT32_MAX, "Can't slice beyond 32-bit sample lengths");
|
||||
for (uint32_t channel = 0; channel < mChannelData.Length(); ++channel) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user