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
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 9b0872e..9497416 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -1570,7 +1570,7 @@
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.