Bug 1265093: Silence CID 1358535. r=gerald
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 20 Apr 2016 16:07:16 +1000
changeset 333863 b432a1067fe7b484e318da41d2de795a0e1c17b2
parent 333862 1687a256328b8f3b3476b1fa5053e1f946134ca7
child 333864 e6fa15a5e1d7699fc95f6e66256de4e04c3e9ff5
push id1146
push userCallek@gmail.com
push dateMon, 25 Jul 2016 16:35:44 +0000
treeherdermozilla-release@a55778f9cd5a [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;