summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-10-30 01:46:37 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-10-30 01:46:37 +0000
commit9243c1057f9c81734e0ce2413d1405d9aba04200 (patch)
tree0fabfae5646a515ec03e6d8d18cd658f25ed2890
parent0d311974181d80b92678c9b2335c40ea5076e9ac (diff)
parent4ac939239e9da3776a57d2f4cf23ad420e14cbb2 (diff)
downloadnative-android11-qpr1-s1-release.tar.gz
Merge cherrypicks of [12952231, 12952640, 12952469, 12952586, 12952232, 12952587, 12952588, 12952589, 12952107, 12952470, 12952641] into rvc-qpr1-releaseandroid-11.0.0_r22android-11.0.0_r21android-11.0.0_r20android-11.0.0_r19android11-qpr1-s1-release
Change-Id: I8e259c5da4a4241f8e80d5504963fad4a701e243
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 148749e6f0..c9e595abd1 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -6227,6 +6227,11 @@ status_t SurfaceFlinger::setFrameRate(const sp<IGraphicBufferProducer>& surface,
Mutex::Autolock lock(mStateLock);
if (authenticateSurfaceTextureLocked(surface)) {
sp<Layer> layer = (static_cast<MonitoredProducer*>(surface.get()))->getLayer();
+ if (layer == nullptr) {
+ ALOGE("Attempt to set frame rate on a layer that no longer exists");
+ return BAD_VALUE;
+ }
+
if (layer->setFrameRate(
Layer::FrameRate(frameRate,
Layer::FrameRate::convertCompatibility(compatibility)))) {