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

Commit 205e0f4a authored by Prabir Pradhan's avatar Prabir Pradhan
Browse files

Check SpriteIcon validity before drawing

Bug: 376270995
Change-Id: I14dfdd9b4777075fe3b04ad69fa2d048de68479d
Flag: EXEMPT adding precondition check
Test: presubmit
parent 222c7b1e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@
namespace android {

bool SpriteIcon::draw(sp<Surface> surface) const {
    LOG_ALWAYS_FATAL_IF(!isValid(), "Cannot draw SpriteIcon: not valid");

    ANativeWindow_Buffer outBuffer;
    status_t status = surface->lock(&outBuffer, NULL);
    if (status) {