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

Commit 1eb82df6 authored by Tao Wu's avatar Tao Wu
Browse files

AudioFlinger: Initialize frames to zero.

Otherwise we could return the uninitialized value when result != OK.

Bug: 143955791
Test: manual - Run the test in the bug and it doesn't crash.
Change-Id: I23b2b0a20202152648a3e40650965bba45127ff3
parent 5c031de6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1570,7 +1570,7 @@ size_t AudioFlinger::getInputBufferSize(uint32_t sampleRate, audio_format_t form
    proposed.format = format;

    sp<DeviceHalInterface> dev = mPrimaryHardwareDev->hwDevice();
    size_t frames;
    size_t frames = 0;
    for (;;) {
        // Note: config is currently a const parameter for get_input_buffer_size()
        // but we use a copy from proposed in case config changes from the call.