mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 21:20:26 -04:00
Make sure to not try dividing by zero
This commit is contained in:
parent
23c86cf27d
commit
df1d3e028e
@ -193,7 +193,7 @@ void APE::Properties::analyzeCurrent()
|
||||
uint blocksPerFrame = header.mid(4, 4).toUInt(false);
|
||||
uint finalFrameBlocks = header.mid(8, 4).toUInt(false);
|
||||
uint totalBlocks = totalFrames > 0 ? (totalFrames - 1) * blocksPerFrame + finalFrameBlocks : 0;
|
||||
d->length = totalBlocks / d->sampleRate;
|
||||
d->length = d->sampleRate > 0 ? totalBlocks / d->sampleRate : 0;
|
||||
d->bitrate = d->length > 0 ? ((d->streamLength * 8L) / d->length) / 1000 : 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user