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

Commit b53300f0 authored by Pawin Vongmasa's avatar Pawin Vongmasa Committed by hamzeh
Browse files

Zero-initialize HIDL structs before passing

Test: cts-tradefed run cts-dev --module CtsMediaTestCases --compatibility:module-arg CtsMediaTestCases:include-annotation:android.platform.test.annotations.RequiresDevice
(only existing failures/flakes)
Bug: 131267328
Bug: 131356202
Change-Id: I91e6e0c692d470f4d3a713068545cedf5ae925a7
Merged-In: I91e6e0c692d470f4d3a713068545cedf5ae925a7

(cherry picked from commit c4a5f5ec)
parent 6ea12db7
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -1056,7 +1056,7 @@ status_t H2BGraphicBufferProducer::detachNextBuffer(


status_t H2BGraphicBufferProducer::attachBuffer(
status_t H2BGraphicBufferProducer::attachBuffer(
        int* outSlot, const sp<GraphicBuffer>& buffer) {
        int* outSlot, const sp<GraphicBuffer>& buffer) {
    AnwBuffer tBuffer;
    AnwBuffer tBuffer{};
    wrapAs(&tBuffer, *buffer);
    wrapAs(&tBuffer, *buffer);
    status_t fnStatus;
    status_t fnStatus;
    status_t transStatus = toStatusT(mBase->attachBuffer(tBuffer,
    status_t transStatus = toStatusT(mBase->attachBuffer(tBuffer,
@@ -1071,7 +1071,7 @@ status_t H2BGraphicBufferProducer::queueBuffer(
        int slot,
        int slot,
        const QueueBufferInput& input,
        const QueueBufferInput& input,
        QueueBufferOutput* output) {
        QueueBufferOutput* output) {
    HGraphicBufferProducer::QueueBufferInput tInput;
    HGraphicBufferProducer::QueueBufferInput tInput{};
    native_handle_t* nh;
    native_handle_t* nh;
    if (!wrapAs(&tInput, &nh, input)) {
    if (!wrapAs(&tInput, &nh, input)) {
        ALOGE("H2BGraphicBufferProducer::queueBuffer - "
        ALOGE("H2BGraphicBufferProducer::queueBuffer - "