commit | f4bd36b72dfde8d67cf62d43d56b8ff27e15e2cc | [log] [tgz] |
---|---|---|
author | Ady Abraham <adyabr@google.com> | Fri Aug 05 19:04:16 2022 +0000 |
committer | Vishnu Nair <vishnun@google.com> | Tue Apr 11 15:49:12 2023 +0000 |
tree | 9a4f30fdb3f8a6837cdbb34f784dd4fbdab7ed15 | |
parent | b218143d95d241509954a82050c747ee18bdffc8 [diff] [blame] |
SurfaceComposerClient: add a range check in setAlpha Merged-In: I172321a4d3533e0506bad75a0a91e33fe921c2b7 Change-Id: I172321a4d3533e0506bad75a0a91e33fe921c2b7 Test: presubmit Bug: 274213741
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index 0f5192d..7001339 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp
@@ -1274,6 +1274,12 @@ 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;