mirror of
https://github.com/taglib/taglib.git
synced 2025-06-04 01:28:21 -04:00
Ah, this one's easy -- though an odd corer case; there's a Xing header here
but no MPEG frames. This was triggering a divide by zero. CCMAIL:83210-done@bugs.kde.org git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@321447 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
parent
2817d4e507
commit
5f2e59150c
@ -192,7 +192,7 @@ void MPEG::Properties::read()
|
||||
double timePerFrame = blockSize[firstHeader.layer()];
|
||||
timePerFrame = timePerFrame / firstHeader.sampleRate();
|
||||
d->length = int(timePerFrame * xingHeader.totalFrames());
|
||||
d->bitrate = xingHeader.totalSize() * 8 / d->length / 1000;
|
||||
d->bitrate = d->length == 0 ? 0 : xingHeader.totalSize() * 8 / d->length / 1000;
|
||||
}
|
||||
|
||||
// Since there was no valid Xing header found, we hope that we're in a constant
|
||||
|
Loading…
x
Reference in New Issue
Block a user