diff options
author | Paul Adenot <paul@paul.cx> | 2022-02-11 13:58:13 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2022-02-11 13:58:13 +0000 |
commit | 5545fc05b7fd6db8bb82f2884b62ca5feda9880c (patch) | |
tree | 84bac89c384b968f8ccb9d74719560c896729bfd /dom | |
parent | c71e9c14994c53f2fb19e17edf3ee0e3bd834d6e (diff) | |
download | aura-central-5545fc05b7fd6db8bb82f2884b62ca5feda9880c.tar.gz |
[DOM media] Handle truncated WAV stream.
Diffstat (limited to 'dom')
-rw-r--r-- | dom/media/wave/WaveDemuxer.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/dom/media/wave/WaveDemuxer.cpp b/dom/media/wave/WaveDemuxer.cpp index 387a75675..5243909de 100644 --- a/dom/media/wave/WaveDemuxer.cpp +++ b/dom/media/wave/WaveDemuxer.cpp @@ -611,7 +611,8 @@ WAVTrackDemuxer::Read(uint8_t* aBuffer, int64_t aOffset, int32_t aSize) { const int64_t streamLen = StreamLength(); if (mInfo && streamLen > 0) { - aSize = std::min<int64_t>(aSize, streamLen - aOffset); + int64_t max = streamLen > aOffset ? streamLen - aOffset : 0; + aSize = std::min<int64_t>(aSize, max); } uint32_t read = 0; const nsresult rv = mSource.ReadAt(aOffset, |