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

Commit 87709c91 authored by Mike Stroyan's avatar Mike Stroyan
Browse files

libgui: Check result in hook_dequeueBuffer_DEPRECATED

Surface::hook_dequeueBuffer_DEPRECATED calls c->dequeueBuffer without
checking the returned result value.  It should check for failing
result and return on error without using the values that
c->dequeueBuffer did not set.

Bug: 28692406
Change-Id: I10f9a23ad1052c5149040124366e0eb91b616267
parent b2dcc3a1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -162,6 +162,9 @@ int Surface::hook_dequeueBuffer_DEPRECATED(ANativeWindow* window,
    ANativeWindowBuffer* buf;
    int fenceFd = -1;
    int result = c->dequeueBuffer(&buf, &fenceFd);
    if (result != OK) {
        return result;
    }
    sp<Fence> fence(new Fence(fenceFd));
    int waitResult = fence->waitForever("dequeueBuffer_DEPRECATED");
    if (waitResult != OK) {