Fixed ID3v2 TXXX ReplayGain reading so it will properly skip over text frames with no description field instead of crashing

CQTexperiment
Chris Moeller 2013-11-05 15:37:54 -08:00
parent 955ea5cdb9
commit a6608b57c4
1 changed files with 2 additions and 1 deletions

View File

@ -196,7 +196,8 @@ float ID3v2::Tag::rg(const String &type) const
const FrameList &list = d->frameListMap["TXXX"];
if (!list.isEmpty()) {
for (FrameList::ConstIterator it = list.begin(); it != list.end(); ++it) {
if (static_cast<UserTextIdentificationFrame *>(*it)->description() == type) {
UserTextIdentificationFrame const* frame = static_cast<UserTextIdentificationFrame *>(*it);
if (!frame->description().isNull() && frame->description() == type) {
return static_cast<UserTextIdentificationFrame *>(*it)->toString().toFloat();
}
}