Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 18644d37 authored by Ady Abraham's avatar Ady Abraham Committed by Automerger Merge Worker
Browse files

SurfaceFlinger: check for nullptr on setFrameRate am: 162f643d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/12794339

Change-Id: I4482a84dd45763b753d698f0304fbac384ec9229
parents 27f73862 162f643d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -6228,6 +6228,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)))) {