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

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

Merge "cameraservice: handle invalid native_handle from vndk impl" into main...

Merge "cameraservice: handle invalid native_handle from vndk impl" into main am: bfb05313 am: 57a394d9

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



Change-Id: Ib66f20c170e7c155cb5d4f54d9ecd1f0fea00af7
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 9af37d3b 57a394d9
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -78,7 +78,13 @@ UOutputConfiguration convertFromAidl(const SOutputConfiguration &src) {

    for (auto &handle : windowHandles) {
        native_handle_t* nh = makeFromAidl(handle);
        iGBPs.push_back(new H2BGraphicBufferProducer(AImageReader_getHGBPFromHandle(nh)));
        auto igbp = AImageReader_getHGBPFromHandle(nh);
        if (igbp == nullptr) {
            ALOGE("%s: Could not get HGBP from NativeHandle: %s. Skipping.",
                    __FUNCTION__, handle.toString().c_str());
            continue;
        }
        iGBPs.push_back(new H2BGraphicBufferProducer(igbp));
        native_handle_delete(nh);
    }
    UOutputConfiguration outputConfiguration(
+7 −1
Original line number Diff line number Diff line
@@ -88,7 +88,13 @@ hardware::camera2::params::OutputConfiguration convertFromHidl(
    auto &windowHandles = hOutputConfiguration.windowHandles;
    iGBPs.reserve(windowHandles.size());
    for (auto &handle : windowHandles) {
        iGBPs.push_back(new H2BGraphicBufferProducer(AImageReader_getHGBPFromHandle(handle)));
        auto igbp = AImageReader_getHGBPFromHandle(handle);
        if (igbp == nullptr) {
            ALOGE("%s: Could not get HGBP from native_handle: %p. Skipping.",
                    __FUNCTION__, handle.getNativeHandle());
            continue;
        }
        iGBPs.push_back(new H2BGraphicBufferProducer(igbp));
    }
    hardware::camera2::params::OutputConfiguration outputConfiguration(
        iGBPs, convertFromHidl(hOutputConfiguration.rotation),