mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Bug 1492365 - Prevent arithmetic overflow. r=gerald
Should mStreamLength be > 2^32, we could have overflowed leading to false positive test. Differential Revision: https://phabricator.services.mozilla.com/D6235 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
70bf79757d
commit
5957f22482
@ -2632,7 +2632,7 @@ MediaCacheStream::ReadBlockFromCache(AutoLock& aLock,
|
||||
}
|
||||
|
||||
if (mStreamLength >= 0 &&
|
||||
aBuffer.Length() > uint32_t(mStreamLength - aOffset)) {
|
||||
int64_t(aBuffer.Length()) > mStreamLength - aOffset) {
|
||||
// Clamp reads to stream's length
|
||||
aBuffer = aBuffer.First(mStreamLength - aOffset);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user