Bug 1358726 - fix the assertion failure in AllocateAndWriteBlock(). r=gerald

block->mOwners might be empty if all streams for the resource id are
closed. We don't bother write the data to the cache since there is no
stream to use it.

MozReview-Commit-ID: KKiyZqLBjim

--HG--
extra : rebase_source : 7fa0a6d841dff91dd7142aac5a336b950342ac67
This commit is contained in:
JW Wang 2017-04-23 21:18:07 +08:00
Родитель 1c5bf085c3
Коммит 69b3ff3c30
1 изменённых файлов: 6 добавлений и 0 удалений

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

@ -1530,6 +1530,12 @@ MediaCache::AllocateAndWriteBlock(
bo->mStream = stream;
}
if (block->mOwners.IsEmpty()) {
// This happens when all streams with the resource id are closed. We can
// just return here now and discard the data.
return;
}
// Tell each stream using this resource about the new block.
for (auto& bo : block->mOwners) {
bo.mStreamBlock = streamBlockIndex;