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

Commit 1e74e241 authored by Eino-Ville Talvala's avatar Eino-Ville Talvala
Browse files

Camera: Don't crash when the device has no vendor tags.

Turns out copying from null pointers crashes things.

Bug: 27466842
Change-Id: I294f03614eec8c488c016469549464065821a7e7
parent ce2d9b46
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -658,8 +658,10 @@ Status CameraService::getCameraVendorTagDescriptor(
        ALOGE("%s: camera hardware module doesn't exist", __FUNCTION__);
        return STATUS_ERROR(ERROR_DISCONNECTED, "Camera subsystem not available");
    }

    *desc = *(VendorTagDescriptor::getGlobalVendorTagDescriptor().get());
    sp<VendorTagDescriptor> globalDescriptor = VendorTagDescriptor::getGlobalVendorTagDescriptor();
    if (globalDescriptor != nullptr) {
        *desc = *(globalDescriptor.get());
    }
    return Status::ok();
}