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

Commit 776a0023 authored by Ajay Dudani's avatar Ajay Dudani Committed by Vineeta Srivastava
Browse files

libstagefright: Check for duration > 0 to avoid divide-by-zero exception

Change-Id: I58ccacbf7ede892dff9626715162ea7b1f2ddbc6
parent 355daed5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -597,7 +597,7 @@ void AwesomePlayer::notifyListener_l(int msg, int ext1, int ext2) {

bool AwesomePlayer::getBitrate(int64_t *bitrate) {
    off64_t size;
    if (mDurationUs >= 0 && mCachedSource != NULL
    if (mDurationUs > 0 && mCachedSource != NULL
            && mCachedSource->getSize(&size) == OK) {
        *bitrate = size * 8000000ll / mDurationUs;  // in bits/sec
        return true;