mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 07:13:20 +00:00
Bug 1702483 - Check for timeCode under-/overflow only when it is time to cast. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D163678
This commit is contained in:
parent
f84bf54d45
commit
01b8969728
@ -100,8 +100,6 @@ nsresult EbmlComposer::WriteSimpleBlock(EncodedFrame* aFrame) {
|
||||
|
||||
int64_t timeCode = aFrame->mTime.ToMicroseconds() / PR_USEC_PER_MSEC -
|
||||
mCurrentClusterTimecode;
|
||||
MOZ_RELEASE_ASSERT(timeCode >= SHRT_MIN);
|
||||
MOZ_RELEASE_ASSERT(timeCode <= SHRT_MAX);
|
||||
|
||||
const bool needClusterHeader =
|
||||
!mHasWrittenCluster ||
|
||||
@ -133,6 +131,9 @@ nsresult EbmlComposer::WriteSimpleBlock(EncodedFrame* aFrame) {
|
||||
timeCode = 0;
|
||||
}
|
||||
|
||||
MOZ_RELEASE_ASSERT(timeCode >= SHRT_MIN);
|
||||
MOZ_RELEASE_ASSERT(timeCode <= SHRT_MAX);
|
||||
|
||||
writeSimpleBlock(&ebml, isOpus ? 0x2 : 0x1, static_cast<short>(timeCode),
|
||||
isVP8IFrame, 0, 0,
|
||||
(unsigned char*)aFrame->mFrameData->Elements(),
|
||||
|
Loading…
Reference in New Issue
Block a user