Fix overflow for large Apple Music cnID values (#1373)

cnID must be longlong instead of int as Apple Music cnID values can now
exceed the range of a 32-bit integer and require 64-bit aka longlong.

---------

Co-authored-by: Urs Fleisch <ufleisch@users.sourceforge.net>
This commit is contained in:
abbott3344
2026-06-26 08:12:16 +03:00
committed by GitHub
parent b42db0ea78
commit e958fa0bfa
2 changed files with 4 additions and 2 deletions

View File

@@ -883,6 +883,7 @@ public:
tag->setItem("trkn", MP4::Item(2, 10));
tag->setItem("rate", MP4::Item(80));
tag->setItem("plID", MP4::Item(1540934238LL));
tag->setItem("cnID", MP4::Item(9876543210LL));
tag->setItem("rtng", MP4::Item(static_cast<unsigned char>(2)));
f.save();
}
@@ -904,6 +905,7 @@ public:
CPPUNIT_ASSERT_EQUAL(10, item.toIntPair().second);
CPPUNIT_ASSERT_EQUAL(80, tag->item("rate").toInt());
CPPUNIT_ASSERT_EQUAL(1540934238LL, tag->item("plID").toLongLong());
CPPUNIT_ASSERT_EQUAL(9876543210LL, tag->item("cnID").toLongLong());
CPPUNIT_ASSERT_EQUAL(static_cast<unsigned char>(2), tag->item("rtng").toByte());
PropertyMap properties = tag->properties();
CPPUNIT_ASSERT_EQUAL(StringList("123"), properties.value("TESTINTEGER"));