diff --git a/taglib/mp4/mp4properties.cpp b/taglib/mp4/mp4properties.cpp index faa43c270..f5be91f7b 100644 --- a/taglib/mp4/mp4properties.cpp +++ b/taglib/mp4/mp4properties.cpp @@ -213,7 +213,12 @@ MP4::Properties::read(File *file, Atoms *atoms) pos += 3; } pos += 10; - d->bitrate = static_cast((data.toUInt(pos) + 500) / 1000.0 + 0.5); + if(data.toUInt(pos) != 0u || d->length <= 0) { + d->bitrate = static_cast((data.toUInt(pos) + 500) / 1000.0 + 0.5); + } + else { + d->bitrate = 8 * (file->length() - atom->offset - atom->length) / d->length; + } } } }