Bug 1414366 - Don't assume aStart is aligned on block boundary in AudioParamTimeline::GetValuesAtTime. r=karlt

MozReview-Commit-ID: JQoDwVPQ2s6

--HG--
extra : rebase_source : f9d653ca530a54f310c915d8745de1266cabb71a
This commit is contained in:
Paul Adenot 2018-07-19 17:58:35 +02:00
Родитель e5c55dd528
Коммит 9fba355645
1 изменённых файлов: 3 добавлений и 1 удалений

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

@ -145,8 +145,10 @@ AudioParamTimeline::GetValuesAtTime(int64_t aTime, float* aBuffer,
// Mix the value of the AudioParam itself with that of the AudioNode inputs.
BaseClass::GetValuesAtTime(aTime, aBuffer, aSize);
if (mStream) {
uint32_t blockOffset = aTime % WEBAUDIO_BLOCK_SIZE;
MOZ_ASSERT(blockOffset + aSize <= WEBAUDIO_BLOCK_SIZE);
for (size_t i = 0; i < aSize; ++i) {
aBuffer[i] += AudioNodeInputValue(i);
aBuffer[i] += AudioNodeInputValue(blockOffset + i);
}
}
}