Maybe fix a crash when loading tags from MP3 files with encrypted frames

This commit is contained in:
David Sansome 2010-12-18 17:01:25 +00:00
parent 6ec77eadf6
commit 623ab527ee
1 changed files with 2 additions and 2 deletions

View File

@ -286,7 +286,7 @@ void Song::InitFromFile(const QString& filename, int directory_id) {
const TagLib::ID3v2::CommentsFrame* frame =
dynamic_cast<const TagLib::ID3v2::CommentsFrame*>(map["COMM"][i]);
if (TStringToQString(frame->description()) != "iTunNORM") {
if (frame && TStringToQString(frame->description()) != "iTunNORM") {
d->comment_ = Decode(frame->text(), codec);
break;
}
@ -297,7 +297,7 @@ void Song::InitFromFile(const QString& filename, int directory_id) {
const TagLib::ID3v2::UserTextIdentificationFrame* frame =
dynamic_cast<const TagLib::ID3v2::UserTextIdentificationFrame*>(map["TXXX"][i]);
if (frame->description().startsWith("FMPS_")) {
if (frame && frame->description().startsWith("FMPS_")) {
ParseFMPSFrame(TStringToQString(frame->description()),
TStringToQString(frame->fieldList()[1]));
}