Skip to content

Commit

Permalink
Avoid potential division by 0 in AudioSyncReader UMA stats calculation
Browse files Browse the repository at this point in the history
Quite unlikely, but still possible.

BUG=

Review URL: https://codereview.chromium.org/1743573002

Cr-Commit-Position: refs/heads/master@{#377888}
  • Loading branch information
olka authored and Commit bot committed Feb 26, 2016
1 parent 2d2b8a0 commit 0635acd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions content/browser/renderer_host/media/audio_sync_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ AudioSyncReader::~AudioSyncReader() {
renderer_missed_callback_count_ -= trailing_renderer_missed_callback_count_;
renderer_callback_count_ -= trailing_renderer_missed_callback_count_;

if (!renderer_callback_count_)
return;

// Recording the percentage of deadline misses gives us a rough overview of
// how many users might be running into audio glitches.
int percentage_missed =
Expand Down

0 comments on commit 0635acd

Please sign in to comment.