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

Commit 2c580d96 authored by Praveen Chavan's avatar Praveen Chavan
Browse files

Codec2: fix leaked graphic buffer handles

Unmap the locked handles when returning from error conditions

b/221226088

Test:
  android.media.cts.ImageReaderDecoderTest#testOtherH265_10BitImage

Change-Id: I7f3dd968a856fb66c15e172131a2357f4a99cd42
parent 078371bd
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -265,6 +265,7 @@ c2_status_t Gralloc4Mapper_lock(native_handle_t *handle, uint64_t usage, const R

        for (const PlaneLayoutComponent &component : plane.components) {
            if (!gralloc4::isStandardPlaneLayoutComponentType(component.type)) {
                mapper.unlock(handle);
                return C2_CANNOT_DO;
            }

@@ -287,6 +288,7 @@ c2_status_t Gralloc4Mapper_lock(native_handle_t *handle, uint64_t usage, const R
                    channel = C2PlaneInfo::CHANNEL_CR;
                    break;
                default:
                    mapper.unlock(handle);
                    return C2_CORRUPTED;
            }