Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0fb6aabf authored by Eric Laurent's avatar Eric Laurent Committed by Android (Google) Code Review
Browse files

Merge "ToneGenerator: fix overflow in stopTone" into jb-mr2-dev

parents ec24fa46 a8eccec7
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -1000,7 +1000,7 @@ void ToneGenerator::stopTone() {
                } else {
                } else {
                    // mSamplingRate is always > 1000
                    // mSamplingRate is always > 1000
                    sec = sec * 1000 + nsec / 1000000; // duration in milliseconds
                    sec = sec * 1000 + nsec / 1000000; // duration in milliseconds
                    mMaxSmp = (sec * mSamplingRate) / 1000;
                    mMaxSmp = (unsigned int)(((int64_t)sec * mSamplingRate) / 1000);
                }
                }
                ALOGV("stopTone() forcing mMaxSmp to %d, total for far %d", mMaxSmp,  mTotalSmp);
                ALOGV("stopTone() forcing mMaxSmp to %d, total for far %d", mMaxSmp,  mTotalSmp);
            } else {
            } else {