OGG: To prevent mediaserver from crash by SIGFPE (divide by zero) and more guarding in getMetaData().

BUG:4689872
Change-Id: I483bf230b5571a8d1815b954dce2c52e9a5f1f37
This commit is contained in:
Dongwon Kang
2011-06-17 22:52:19 +09:00
parent b0cd4e2e7c
commit 48810fdda5

View File

@@ -730,8 +730,9 @@ status_t MyVorbisExtractor::verifyHeader(
off64_t size;
if (mSource->getSize(&size) == OK) {
uint64_t bps = approxBitrate();
mMeta->setInt64(kKeyDuration, size * 8000000ll / bps);
if (bps != 0) {
mMeta->setInt64(kKeyDuration, size * 8000000ll / bps);
}
}
break;
}