Fix a problem with reading uninitialized memory in ACM

When an "empty frame" was produced by ACMGenericCodecWrapper::Encode,
the timestamp value was not set. This is now fixed, and the first byte
of the bitstream is set to something as well to avoid similar problems.

BUG=chromium:459483
R=jmarusic@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/34269004

Cr-Commit-Position: refs/heads/master@{#8431}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8431 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_generic_codec.cc b/webrtc/modules/audio_coding/main/acm2/acm_generic_codec.cc
index 5e9930e..6dd6f3e 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_generic_codec.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_generic_codec.cc
@@ -1224,11 +1224,15 @@
                          2 * MAX_PAYLOAD_SIZE_BYTE, bitstream, encoded_info));
   input_.clear();
   *bitstream_len_byte = static_cast<int16_t>(encoded_info->encoded_bytes);
+  *timestamp = encoded_info->encoded_timestamp;
   if (encoded_info->encoded_bytes == 0) {
     *encoding_type = kNoEncoding;
-    return encoded_info->send_even_if_empty ? 1 : 0;
+    if (encoded_info->send_even_if_empty) {
+      bitstream[0] = 0;
+      return 1;
+    }
+    return 0;
   }
-  *timestamp = encoded_info->encoded_timestamp;
 
   int payload_type = encoded_info->payload_type;
   if (!encoded_info->redundant.empty())