Fix integer overflow and divide-by-zero

Bug: 35763994
Test: ran CTS with and without fix
Change-Id: If835e97ce578d4fa567e33e349e48fb7b2559e0e
(cherry picked from commit 8538a603ef992e75f29336499cb783f3ec19f18c)

AMRSource::~AMRSource() {
 if (mStarted) {
        stop();
 }
}

AMRSource::~AMRSource() {
 if (mStarted) {
        stop();
 }
}
