Bug 1319543: Prevent overflow if sample's time is negative. r?gerald draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 23 Nov 2016 11:21:42 +1100
changeset 442644 00982487d5a03269b1178eb634da927c20135b5f
parent 442262 7960dc784d8783aaaa52479006243f9f30153523
child 537854 d85b84f6fcade09461f58687bb2256ac1143f4f7
push id36770
push userbmo:jyavenard@mozilla.com
push dateWed, 23 Nov 2016 00:23:20 +0000
reviewersgerald
bugs1319543
milestone53.0a1
Bug 1319543: Prevent overflow if sample's time is negative. r?gerald MozReview-Commit-ID: I94vvJccOqE
dom/media/platforms/agnostic/VorbisDecoder.cpp
--- a/dom/media/platforms/agnostic/VorbisDecoder.cpp
+++ b/dom/media/platforms/agnostic/VorbisDecoder.cpp
@@ -149,17 +149,17 @@ VorbisDataDecoder::ProcessDecode(MediaRa
 MediaResult
 VorbisDataDecoder::DoDecode(MediaRawData* aSample)
 {
   MOZ_ASSERT(mTaskQueue->IsCurrentThreadIn());
 
   const unsigned char* aData = aSample->Data();
   size_t aLength = aSample->Size();
   int64_t aOffset = aSample->mOffset;
-  uint64_t aTstampUsecs = aSample->mTime;
+  int64_t aTstampUsecs = aSample->mTime;
   int64_t aTotalFrames = 0;
 
   MOZ_ASSERT(mPacketCount >= 3);
 
   if (!mLastFrameTime || mLastFrameTime.ref() != aSample->mTime) {
     // We are starting a new block.
     mFrames = 0;
     mLastFrameTime = Some(aSample->mTime);