projects
/
taglib
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
23c86cf
)
Make sure to not try dividing by zero
author
Lukáš Lalinský
<lalinsky@gmail.com>
Sun, 4 Mar 2012 10:51:05 +0000
(11:51 +0100)
committer
Lukáš Lalinský
<lalinsky@gmail.com>
Sat, 10 Mar 2012 08:12:19 +0000
(09:12 +0100)
taglib/ape/apeproperties.cpp
patch
|
blob
|
history
diff --git
a/taglib/ape/apeproperties.cpp
b/taglib/ape/apeproperties.cpp
index 3154d1045605de5cbb1fc85ad42a5e7743ec4aa6..7f9cdb5af576635d8d72f50a9c7dd8626e928397 100644
(file)
--- a/
taglib/ape/apeproperties.cpp
+++ b/
taglib/ape/apeproperties.cpp
@@
-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;
}