mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 08:48:39 +09:00
Bug 1737816 - Handle truncated mp3 resources. r=bryce, a=RyanVM
This commit is contained in:
parent
62a879b694
commit
258790bf38
1 changed files with 2 additions and 1 deletions
|
|
@ -676,8 +676,9 @@ MP3TrackDemuxer::Read(uint8_t* aBuffer, int64_t aOffset, int32_t aSize) {
|
|||
|
||||
const int64_t streamLen = StreamLength();
|
||||
if (mInfo && streamLen > 0) {
|
||||
uint64_t max = streamLen > aOffset ? streamLen - aOffset : 0;
|
||||
// Prevent blocking reads after successful initialization.
|
||||
aSize = std::min<int64_t>(aSize, streamLen - aOffset);
|
||||
aSize = std::min<int64_t>(aSize, max);
|
||||
}
|
||||
|
||||
uint32_t read = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue