Bug 1265093: Silence CID 1358535. r=gerald
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 20 Apr 2016 16:07:16 +1000
changeset 331873 b432a1067fe7b484e318da41d2de795a0e1c17b2
parent 331872 1687a256328b8f3b3476b1fa5053e1f946134ca7
child 331874 e6fa15a5e1d7699fc95f6e66256de4e04c3e9ff5
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1265093, 1358535
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1265093: Silence CID 1358535. r=gerald It was a false positive, has mData can only be null if mLength is also 0. MozReview-Commit-ID: LcPtn49ew6e
dom/media/MediaData.h
--- a/dom/media/MediaData.h
+++ b/dom/media/MediaData.h
@@ -235,18 +235,22 @@ private:
     }
 
     // Find alignment address.
     const uintptr_t alignmask = AlignmentOffset();
     Type* newData = reinterpret_cast<Type*>(
       (reinterpret_cast<uintptr_t>(newBuffer.get()) + alignmask) & ~alignmask);
     MOZ_ASSERT(uintptr_t(newData) % (AlignmentOffset()+1) == 0);
 
+    MOZ_ASSERT(!mLength || mData);
+
     PodZero(newData + mLength, aLength - mLength);
-    PodCopy(newData, mData, mLength);
+    if (mLength) {
+      PodCopy(newData, mData, mLength);
+    }
 
     mBuffer = Move(newBuffer);
     mCapacity = sizeNeeded.value();
     mData = newData;
 
     return true;
   }
   Type* mData;