Bug 523814 - Refresh entry pointer after hashtable mutation in NotifyBlockSwapped. r=roc
authorMatthew Gregan <kinetik@flim.org>
Fri, 23 Oct 2009 15:18:54 +1300
changeset 34135 6ef41ffcc5213f70a9ac3748ef66cb26ec992f19
parent 34134 6cd78a2719be3ded6943e472c60d98d2e46811a1
child 34136 dd0c05fc94a7fbdd12af4da528fb47891fde8e84
push idunknown
push userunknown
push dateunknown
reviewersroc
bugs523814
milestone1.9.3a1pre
Bug 523814 - Refresh entry pointer after hashtable mutation in NotifyBlockSwapped. r=roc
content/media/nsMediaCache.cpp
--- a/content/media/nsMediaCache.cpp
+++ b/content/media/nsMediaCache.cpp
@@ -460,16 +460,18 @@ nsMediaCacheStream::BlockList::NotifyBlo
     mEntries.GetEntry(e2Next)->mPrevBlock = aBlockIndex1;
   }
 
   // Fix hashtable keys. First remove stale entries.
   if (e1) {
     e1Prev = e1->mPrevBlock;
     e1Next = e1->mNextBlock;
     mEntries.RemoveEntry(aBlockIndex1);
+    // Refresh pointer after hashtable mutation.
+    e2 = mEntries.GetEntry(aBlockIndex2);
   }
   if (e2) {
     e2Prev = e2->mPrevBlock;
     e2Next = e2->mNextBlock;
     mEntries.RemoveEntry(aBlockIndex2);
   }
   // Put new entries back.
   if (e1) {