summaryrefslogtreecommitdiff
path: root/libs/gui/SurfaceComposerClient.cpp
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2019-03-28 16:15:30 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-03-28 16:15:30 +0000
commit0801473321553b9f0e772d6a44c53ddcf12fc5ac (patch)
tree2167f08ceb03f007de364c3abc66d91b9e3ee9e7 /libs/gui/SurfaceComposerClient.cpp
parente72ecd3e9c79eaca73bd63dcf4b7d25fd2e94f93 (diff)
parent0059724cf8d83b018be2b55dc400166fe86e2af4 (diff)
Merge "blast: fix caching crash"
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
-rw-r--r--libs/gui/SurfaceComposerClient.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 84aed5f51c..56a3fbc0c5 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -406,6 +406,12 @@ void SurfaceComposerClient::Transaction::cacheBuffers() {
continue;
}
+ // Don't try to cache a null buffer. Sending null buffers is cheap so we shouldn't waste
+ // time trying to cache them.
+ if (!s->buffer) {
+ continue;
+ }
+
uint64_t cacheId = 0;
status_t ret = BufferCache::getInstance().getCacheId(s->buffer, &cacheId);
if (ret == NO_ERROR) {