OSDN Git Service
(root)
/
android-x86
/
frameworks-native.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2c27592
)
Nullptr check for VSyncClient::Wait
author
Okan Arikan
<okana@google.com>
Fri, 3 Feb 2017 23:06:35 +0000
(15:06 -0800)
committer
Okan Arikan
<okana@google.com>
Mon, 6 Feb 2017 18:06:03 +0000
(18:06 +0000)
as the documentation in the header implies
Bug:
34609900
Test: pass nullptr to Wait and observe your code not crashing
Change-Id: Ia3ead8cf3369bddedfca4606d0fa261fd57c281f
(cherry picked from commit
a919630f3c7cd3c2ee90ef39cbf8147681dd9be8
)
libs/vr/libdisplay/vsync_client.cpp
patch
|
blob
|
history
diff --git
a/libs/vr/libdisplay/vsync_client.cpp
b/libs/vr/libdisplay/vsync_client.cpp
index
a0fb313
..
c928a08
100644
(file)
--- a/
libs/vr/libdisplay/vsync_client.cpp
+++ b/
libs/vr/libdisplay/vsync_client.cpp
@@
-26,7
+26,10
@@
int VSyncClient::Wait(int64_t* timestamp_ns) {
status.GetErrorMessage().c_str());
return -status.error();
}
- *timestamp_ns = status.get();
+
+ if (timestamp_ns != nullptr) {
+ *timestamp_ns = status.get();
+ }
return 0;
}