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

Commit f4bd36b7 authored by Ady Abraham's avatar Ady Abraham Committed by Vishnu Nair
Browse files

SurfaceComposerClient: add a range check in setAlpha

Merged-In: I172321a4d3533e0506bad75a0a91e33fe921c2b7
Change-Id: I172321a4d3533e0506bad75a0a91e33fe921c2b7
Test: presubmit
Bug: 274213741
parent b218143d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1274,6 +1274,12 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setAlpha
        mStatus = BAD_INDEX;
        return *this;
    }
    if (alpha < 0.0f || alpha > 1.0f) {
        ALOGE("SurfaceComposerClient::Transaction::setAlpha: invalid alpha %f", alpha);
        mStatus = BAD_VALUE;
        return *this;

    }
    s->what |= layer_state_t::eAlphaChanged;
    s->alpha = alpha;