Bug 1852170 - check if the duration is valid. r=media-playback-reviewers,azebrowski

Differential Revision: https://phabricator.services.mozilla.com/D187803
This commit is contained in:
alwu 2023-09-09 03:36:42 +00:00
parent 7341e5e84d
commit 1c3f68905f

View File

@ -273,7 +273,7 @@ already_AddRefed<MediaRawData> OggCodecState::PacketOutAsMediaRawData() {
NS_ASSERTION(endTimestamp.IsPositiveOrZero(), "timestamp invalid");
TimeUnit duration = PacketDuration(packet.get());
if (!duration.IsPositiveOrZero()) {
if (!duration.IsValid() || !duration.IsPositiveOrZero()) {
NS_WARNING(
nsPrintfCString("duration invalid! (%s)", duration.ToString().get())
.get());