mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1033066: Never let AudioSegments underflow mDuration and cause OOM allocation r=karlt
This commit is contained in:
parent
91f039742d
commit
4722e9943c
@ -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…
Reference in New Issue
Block a user