Merge "Fix a crash happening in NBLog's 'writeHistToFile'" into oc-dr1-dev am: 4f771e05db
am: 2a78bf88d4

Change-Id: Ie82fd23b310aa55f33568c8f4a3bf5eda57964d6
diff --git a/media/libnbaio/NBLog.cpp b/media/libnbaio/NBLog.cpp
index f90d7fc..a352b15 100644
--- a/media/libnbaio/NBLog.cpp
+++ b/media/libnbaio/NBLog.cpp
@@ -875,10 +875,10 @@
     static const char* const kName = (char *)"/data/misc/audioserver/sample_results.txt";
     // stores deltas between the samples
     std::vector<int64_t> intervals;
-    if (samples.size() == 0) return;
     for (size_t i = 1; i < samples.size(); ++i) {
         intervals.push_back(deltaMs(samples[i - 1], samples[i]));
     }
+    if (intervals.empty()) return;
     // Deletes maximum value in a histogram. Temp quick fix.
     // FIXME: need to find root cause of approx. 35th element from the end
     // consistently being an outlier in the first histogram of a flush