Bug 1336009 - null Java object check before accessing. r=jchen a=gchang
authorJohn Lin <jolin@mozilla.com>
Thu, 02 Feb 2017 17:14:10 +0800
changeset 378218 0c836d66d8ab986fd1d7a8bb71cf8ec8240f48aa
parent 378217 673d97776e64b8084064e59bca9cac760b7a11f9
child 378219 2fd7a81771a7dd8c4dc47ee6199adac8500cd01f
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjchen, gchang
bugs1336009
milestone53.0a2
Bug 1336009 - null Java object check before accessing. r=jchen a=gchang MozReview-Commit-ID: 8Wkr2nnXacs
dom/media/platforms/android/RemoteDataDecoder.cpp
--- a/dom/media/platforms/android/RemoteDataDecoder.cpp
+++ b/dom/media/platforms/android/RemoteDataDecoder.cpp
@@ -593,23 +593,26 @@ RemoteDataDecoder::Drain()
 
   mJavaDecoder->Input(nullptr, bufferInfo, nullptr);
 }
 
 void
 RemoteDataDecoder::Shutdown()
 {
   LOG("");
-  MOZ_ASSERT(mJavaDecoder && mJavaCallbacks);
 
-  mJavaDecoder->Release();
-  mJavaDecoder = nullptr;
+  if (mJavaDecoder) {
+    mJavaDecoder->Release();
+    mJavaDecoder = nullptr;
+  }
 
-  JavaCallbacksSupport::GetNative(mJavaCallbacks)->Cancel();
-  mJavaCallbacks = nullptr;
+  if (mJavaCallbacks) {
+    JavaCallbacksSupport::GetNative(mJavaCallbacks)->Cancel();
+    mJavaCallbacks = nullptr;
+  }
 
   mFormat = nullptr;
 }
 
 void
 RemoteDataDecoder::Input(MediaRawData* aSample)
 {
   MOZ_ASSERT(aSample != nullptr);