mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-02 05:17:31 +09:00
Bug 1746011 - Handle truncated ADTS stream. r=bryce, a=RyanVM
This commit is contained in:
parent
b2b02865a8
commit
62a879b694
1 changed files with 2 additions and 1 deletions
|
|
@ -819,8 +819,9 @@ ADTSTrackDemuxer::Read(uint8_t* aBuffer, int64_t aOffset, int32_t aSize)
|
||||||
|
|
||||||
const int64_t streamLen = StreamLength();
|
const int64_t streamLen = StreamLength();
|
||||||
if (mInfo && streamLen > 0) {
|
if (mInfo && streamLen > 0) {
|
||||||
|
int64_t max = streamLen > aOffset ? streamLen - aOffset : 0;
|
||||||
// Prevent blocking reads after successful initialization.
|
// 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;
|
uint32_t read = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue