mirror of
https://github.com/taglib/taglib.git
synced 2026-11-05 22:18:50 -05:00
If the standard library checks the index in std::vector::operator[] (_GLIBCXX_ASSERTIONS, libc++ hardening modes), ByteVector::operator[] and List::operator[] now check the index against their own size and abort if it is out of range, as std::vector does. The std::vector check alone is not enough: a ByteVector created by mid() shares the buffer of the original byte vector, so an index past the end of the smaller vector still passes it. List::operator[] walks a std::list, which these checks do not cover. Builds without these macros are unchanged; a GCC Release build of libtag produces identical code. The Ubuntu CI job now builds with -D_GLIBCXX_ASSERTIONS so that the tests run with the checks enabled.