Bug 1058400 - Fix AppleCMLinker assertion. r=cpearce
authorRalph Giles <giles@mozilla.com>
Tue, 26 Aug 2014 13:26:00 -0700
changeset 223391 c5fbcc0109b3a413a103d9752e18a879a5492f1d
parent 223390 8ad9756bb02568bffe436f26b794e0b5e4baa851
child 223392 4a3a302f1f31b99182436597840fdbe35389c65c
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1058400
milestone34.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 1058400 - Fix AppleCMLinker assertion. r=cpearce We call Unlink() from the failure cleanup code in Link() when the dlopen call fails, so it's incorrect to assert that sLink is non-null. We've already incremented the refcount, so that check is fine.
content/media/fmp4/apple/AppleCMLinker.cpp
content/media/fmp4/apple/AppleVTLinker.cpp
--- a/content/media/fmp4/apple/AppleCMLinker.cpp
+++ b/content/media/fmp4/apple/AppleCMLinker.cpp
@@ -68,17 +68,17 @@ fail:
   sLinkStatus = LinkStatus_FAILED;
   return false;
 }
 
 /* static */ void
 AppleCMLinker::Unlink()
 {
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(sLink && sRefCount > 0, "Unbalanced Unlink()");
+  MOZ_ASSERT(sRefCount > 0, "Unbalanced Unlink()");
   --sRefCount;
   if (sLink && sRefCount < 1) {
     LOG("Unlinking CoreMedia framework.");
     dlclose(sLink);
     sLink = nullptr;
   }
 }
 
--- a/content/media/fmp4/apple/AppleVTLinker.cpp
+++ b/content/media/fmp4/apple/AppleVTLinker.cpp
@@ -72,17 +72,17 @@ fail:
 /* static */ void
 AppleVTLinker::Unlink()
 {
   // We'll be called by multiple Decoders, one intantiated for
   // each media element. Therefore we receive must maintain a
   // reference count to avoidunloading our symbols when other
   // instances still need them.
   MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(sLink && sRefCount > 0, "Unbalanced Unlink()");
+  MOZ_ASSERT(sRefCount > 0, "Unbalanced Unlink()");
   --sRefCount;
   if (sLink && sRefCount < 1) {
     LOG("Unlinking VideoToolbox framework.");
     dlclose(sLink);
     sLink = nullptr;
   }
 }