Bug 1319543: Prevent overflow if sample's time is negative. r=gerald
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 23 Nov 2016 11:21:42 +1100
changeset 323954 3e36c1367ba2453e8325fbd1f9487255f345bd1f
parent 323953 31a06ae32d3b93afeb40deb6f4ebc1b62d9e98f5
child 323955 e52d162e55a32d6f9a905ab1eb4831f0bb98593f
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +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);