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

Commit a2e22a12 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "codec2: unlock GraphicBuffer if lockYCbCr succeeded but could not process it" am: 9313acc2

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/1763727

Change-Id: I3e7e94c6960798f0dc9dca125b32c497aa3e4784
parents f28d8523 9313acc2
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -748,6 +748,16 @@ c2_status_t C2AllocationGralloc::map(

            // We really don't know what this is; lock the buffer and pass it through ---
            // the client may know how to interpret it.

            // unlock previous allocation if it was successful
            if (err == OK) {
                err = GraphicBufferMapper::get().unlock(mBuffer);
                if (err) {
                    ALOGE("failed transaction: unlock");
                    return C2_CORRUPTED;
                }
            }

            void *pointer = nullptr;
            err = GraphicBufferMapper::get().lock(
                    const_cast<native_handle_t *>(mBuffer), grallocUsage, rect, &pointer);