Fixes access violation

- Fixes access violation when setting empty stringlist on integer
  properties in mp4 tag
- Add a unit test that validates the fix.
This commit is contained in:
Erwin Jansen
2015-10-09 22:11:27 -07:00
parent ab30ec3a6f
commit 29be00dc59
2 changed files with 11 additions and 3 deletions

View File

@ -305,6 +305,14 @@ public:
CPPUNIT_ASSERT(f.tag()->contains("cpil"));
CPPUNIT_ASSERT_EQUAL(false, f.tag()->item("cpil").toBool());
CPPUNIT_ASSERT_EQUAL(StringList("0"), tags["COMPILATION"]);
// Empty properties do not result in access violations
// when converting integers
tags["TRACKNUMBER"] = StringList();
tags["DISCNUMBER"] = StringList();
tags["BPM"] = StringList();
tags["COMPILATION"] = StringList();
f.setProperties(tags);
}
void testFuzzedFile()