[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser/tor-browser-78.5.0esr-10.5-1] Bug 1650281 - P2: Make sure `gCombinedSizes` won't be underflowed r=gerald



commit 29264dc53cb59a7cc7e1a8991ef937533bd50866
Author: Chun-Min Chang <chun.m.chang@xxxxxxxxx>
Date:   Tue Jul 21 23:39:14 2020 +0000

    Bug 1650281 - P2: Make sure `gCombinedSizes` won't be underflowed r=gerald
    
    In any case, `gCombinedSizes` should be larger than or equal to the
    buffer within `MemoryClockCache`.
    
    Differential Revision: https://phabricator.services.mozilla.com/D84274
---
 dom/media/MemoryBlockCache.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dom/media/MemoryBlockCache.cpp b/dom/media/MemoryBlockCache.cpp
index bf073e6769d0..2848a3f3812c 100644
--- a/dom/media/MemoryBlockCache.cpp
+++ b/dom/media/MemoryBlockCache.cpp
@@ -52,6 +52,7 @@ MemoryBlockCache::MemoryBlockCache(int64_t aContentLength)
 }
 
 MemoryBlockCache::~MemoryBlockCache() {
+  MOZ_ASSERT(gCombinedSizes >= mBuffer.Length());
   size_t sizes = static_cast<size_t>(gCombinedSizes -= mBuffer.Length());
   LOG("~MemoryBlockCache() - destroying buffer of size %zu; combined sizes now "
       "%zu",



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits