Bug 1413108 - |count| is not incremented correctly in MediaCacheStream::Read() when reading the partial block.
MozReview-Commit-ID: GzY2LqosWwO
--- a/dom/media/MediaCache.cpp
+++ b/dom/media/MediaCache.cpp
@@ -2487,17 +2487,17 @@ MediaCacheStream::Read(char* aBuffer, ui
bytes = std::min(bytes, int64_t(INT32_MAX));
MOZ_ASSERT(bytes >= 0 && bytes <= aCount, "Bytes out of range.");
memcpy(aBuffer,
streamWithPartialBlock->mPartialBlockBuffer.get() + offsetInStreamBlock, bytes);
if (mCurrentMode == MODE_METADATA) {
streamWithPartialBlock->mMetadataInPartialBlockBuffer = true;
}
streamOffset += bytes;
- count = bytes;
+ count += bytes;
break;
}
// No data has been read yet, so block
mon.Wait();
if (mClosed) {
// We may have successfully read some data, but let's just throw
// that out.