Merge "Fix unsigned long cast for 64 bit" into nyc-dev
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index eb84183..a4ea34c 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -2069,7 +2069,9 @@
         ALOGV("%s: read failed - sleeping for buffer duration", __func__);
         usleep(bytes * 1000000 / audio_stream_in_frame_size(stream) /
                in_get_sample_rate(&in->stream.common));
-    } else {
+        memset(buffer, 0, bytes); // clear return data
+    }
+    if (bytes > 0) {
         in->frames_read += bytes / audio_stream_in_frame_size(stream);
     }
     return bytes;