diff options
| author | 2021-01-20 21:06:20 -0800 | |
|---|---|---|
| committer | 2021-01-20 21:09:51 -0800 | |
| commit | 3a2e1ce8eaa22b57af0baca0049cd7f8d2627774 (patch) | |
| tree | f07dcc818d94b2917a43684c9d5de7b4ebb2b5ff /libs/gui/QueueBufferInputOutput.cpp | |
| parent | da4a5ca5b7cd4865c315d41fad30f56db0a1a13e (diff) | |
nativewindow: report errors on error to allocate a handle
At the moment, `outBuffer` won't be set if `err == 0 && gbuffer->handle
!= nullptr`, even though we return a zero value for `err`. This causes
us to pass nullptr to AHardwareBuffer_release in
AHardwareBuffer_isSupported, which isn't correct.
Caught by the static analyzer:
> frameworks/native/libs/nativewindow/AHardwareBuffer.cpp:394:9:
warning: Null passed to a callee that requires a non-null 1st parameter
[clang-analyzer-nullability.NullPassedToNonnull]
This also replaces 0 with nullptr, since we're checking a pointer's
value here.
Bug: None
Test: TreeHugger
Change-Id: Id2fad234f98eda71b06419193e15cbfb5fa39bf1
Diffstat (limited to 'libs/gui/QueueBufferInputOutput.cpp')
0 files changed, 0 insertions, 0 deletions