Bug 1573381 - "gtest MediaMIMETypes.MediaCodecs fails: Bug in MediaCodecs::ContainsPrefix()". r=bvandyk
author<msirringhaus>
Tue, 13 Aug 2019 00:50:00 +0300
changeset 554034 3d47c2d160a7ed1394f56211ca70b2f53f0e9750
parent 554033 253ee438b626cc0286c02e77765f990c6b37939f
child 554035 c72fb6d63304f4b5df0dd05a3d2973b1fd4ee0da
push id2165
push userffxbld-merge
push dateMon, 14 Oct 2019 16:30:58 +0000
treeherdermozilla-release@0eae18af659f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbvandyk
bugs1573381
milestone70.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 1573381 - "gtest MediaMIMETypes.MediaCodecs fails: Bug in MediaCodecs::ContainsPrefix()". r=bvandyk
dom/media/MediaMIMETypes.cpp
--- a/dom/media/MediaMIMETypes.cpp
+++ b/dom/media/MediaMIMETypes.cpp
@@ -82,17 +82,17 @@ bool MediaCodecs::ContainsAll(const Medi
   }
   return true;
 }
 
 bool MediaCodecs::ContainsPrefix(const nsAString& aCodecPrefix) const {
   const size_t prefixLength = aCodecPrefix.Length();
   for (const auto& myCodec : Range()) {
     if (myCodec.Length() >= prefixLength &&
-        memcmp(myCodec.Data(), aCodecPrefix.Data(), prefixLength) == 0) {
+        memcmp(myCodec.Data(), aCodecPrefix.Data(), prefixLength * sizeof(char16_t)) == 0) {
       return true;
     }
   }
   return false;
 }
 
 size_t MediaCodecs::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const {
   return mCodecs.SizeOfExcludingThisIfUnshared(aMallocSizeOf);