Fix segfault.

This commit is contained in:
John Maguire 2010-06-03 13:02:24 +00:00
parent b9df2a09d4
commit 407bc7a41e
1 changed files with 4 additions and 0 deletions

View File

@ -169,6 +169,10 @@ QTextCodec* UniversalEncodingHandler::Guess(const TagLib::Tag& tag) {
Guess(tag.comment(), &usages);
Guess(tag.genre(), &usages);
if (usages.isEmpty()) {
return NULL;
}
QHash<QTextCodec*, int>::const_iterator max = usages.begin();
for (QHash<QTextCodec*, int>::const_iterator it = usages.begin(); it != usages.end(); ++it) {
if (it.value() > max.value()) {