bug 1225003 null-check mBuffer in SizeOfExcludingThis() r=padenot

This commit is contained in:
Karl Tomlinson 2015-11-17 08:58:48 +13:00
parent 87114f605c
commit ef06316a55
2 changed files with 6 additions and 2 deletions

View File

@ -178,7 +178,9 @@ public:
virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
{
size_t amount = AudioNodeEngine::SizeOfExcludingThis(aMallocSizeOf);
amount += mBuffer->SizeOfIncludingThis(aMallocSizeOf);
if (mBuffer) {
amount += mBuffer->SizeOfIncludingThis(aMallocSizeOf);
}
return amount;
}

View File

@ -600,7 +600,9 @@ WebAudioDecodeJob::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
if (mOutput) {
amount += mOutput->SizeOfIncludingThis(aMallocSizeOf);
}
amount += mBuffer->SizeOfIncludingThis(aMallocSizeOf);
if (mBuffer) {
amount += mBuffer->SizeOfIncludingThis(aMallocSizeOf);
}
return amount;
}