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

Commit a40cc472 authored by Vineeta Srivastava's avatar Vineeta Srivastava Committed by Android (Google) Code Review
Browse files

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

parents fe7e0c61 776a0023
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;