Fix invalid PlatformSensorReaderWinrt creation due to bad switch case
The PlatformSensorReaderWinrtBase::IsSensorCreateSuccess function has a switch case that determines whether a PlatformSensorReader was successfully created. The kErrorGetMinReportIntervalFailed (which is not fatal) and kErrorISensorWinrtStaticsActivationFailedcases (which is fatal) cases should have been swapped. This is causing a non-null PlatformSensorReader to be returned, but the underlying WinRT sensor object was null which triggers a null pointer deference the next time it is used. The fix is to swap the switch cases. Verified by running the new unit test. Bug: 1020987 Change-Id: Ia9ac960fb95de0b028677c1ff97b632aecd0b6f2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1904503 Commit-Queue: Wenjie Shi <wensh@microsoft.com> Reviewed-by:Reilly Grant <reillyg@chromium.org> Cr-Commit-Position: refs/heads/master@{#713672}
Showing
This diff is collapsed.
Please register or sign in to comment