Bug 1317513 - Add missing null check in DeviceManagerDx::HasDeviceReset. (bug 1317513, r=rhunt, a=jcristau
authorDavid Anderson <danderson@mozilla.com>
Mon, 14 Nov 2016 16:38:26 -0800
changeset 352549 f30fda8d65c4ed42a7a1db27a44202f7fa1d9baa
parent 352548 dc6138379852b710e43a5af3f82c02a6d2465a15
child 352550 36be34c8798ac7bbf7595f6f1eb5865affad9bca
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrhunt, jcristau
bugs1317513
milestone52.0a2
Bug 1317513 - Add missing null check in DeviceManagerDx::HasDeviceReset. (bug 1317513, r=rhunt, a=jcristau
gfx/thebes/DeviceManagerDx.cpp
--- a/gfx/thebes/DeviceManagerDx.cpp
+++ b/gfx/thebes/DeviceManagerDx.cpp
@@ -660,24 +660,28 @@ static DeviceResetReason HResultToResetR
 }
 
 bool
 DeviceManagerDx::HasDeviceReset(DeviceResetReason* aOutReason)
 {
   MutexAutoLock lock(mDeviceLock);
 
   if (mDeviceResetReason) {
-    *aOutReason = mDeviceResetReason.value();
+    if (aOutReason) {
+      *aOutReason = mDeviceResetReason.value();
+    }
     return true;
   }
 
   DeviceResetReason reason;
   if (GetAnyDeviceRemovedReason(&reason)) {
     mDeviceResetReason = Some(reason);
-    *aOutReason = reason;
+    if (aOutReason) {
+      *aOutReason = reason;
+    }
     return true;
   }
 
   return false;
 }
 
 static inline bool
 DidDeviceReset(const RefPtr<ID3D11Device>& aDevice, DeviceResetReason* aOutReason)