Add missing null check in DeviceManagerDx::HasDeviceReset. (bug 1317513, r=rhunt)
authorDavid Anderson <danderson@mozilla.com>
Mon, 14 Nov 2016 16:38:26 -0800
changeset 322461 039eb9887533e5a33d33f4a655ff988c2f38e348
parent 322460 5f6b4c2d10f50bf346783998ddfe6e3e34897503
child 322462 91b1add28ef64ca507a1c1c14db2031ae37c992b
push id83880
push userdanderson@mozilla.com
push dateTue, 15 Nov 2016 00:39:43 +0000
treeherdermozilla-inbound@039eb9887533 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrhunt
bugs1317513
milestone52.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
Add missing null check in DeviceManagerDx::HasDeviceReset. (bug 1317513, r=rhunt)
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)