mirror of
https://github.com/taglib/taglib.git
synced 2026-05-25 13:08:55 -04:00
Apply stco/co64 bounds fix from PR #1333 to MP4 chapter code
The updateChunkOffsets() function in mp4qtchapterlist.cpp and mp4chapterlist.cpp is duplicated code from mp4tag.cpp and needs the patch from mp4tag.cpp too.
This commit is contained in:
committed by
Ryan Francesconi
parent
ba2441b378
commit
0df52e3993
@@ -83,7 +83,8 @@ namespace
|
||||
unsigned int count = data.toUInt();
|
||||
file->seek(atom->offset() + 16);
|
||||
unsigned int pos = 4;
|
||||
while(count--) {
|
||||
const unsigned int maxPos = data.size() - 4;
|
||||
while(count-- && pos <= maxPos) {
|
||||
auto o = static_cast<offset_t>(data.toUInt(pos));
|
||||
if(o > offset)
|
||||
o += delta;
|
||||
@@ -101,7 +102,8 @@ namespace
|
||||
unsigned int count = data.toUInt();
|
||||
file->seek(atom->offset() + 16);
|
||||
unsigned int pos = 4;
|
||||
while(count--) {
|
||||
const unsigned int maxPos = data.size() - 8;
|
||||
while(count-- && pos <= maxPos) {
|
||||
long long o = data.toLongLong(pos);
|
||||
if(o > offset)
|
||||
o += delta;
|
||||
|
||||
@@ -95,7 +95,8 @@ namespace
|
||||
unsigned int count = data.toUInt();
|
||||
file->seek(atom->offset() + 16);
|
||||
unsigned int pos = 4;
|
||||
while(count--) {
|
||||
const unsigned int maxPos = data.size() - 4;
|
||||
while(count-- && pos <= maxPos) {
|
||||
auto o = static_cast<offset_t>(data.toUInt(pos));
|
||||
if(o > offset)
|
||||
o += delta;
|
||||
@@ -113,7 +114,8 @@ namespace
|
||||
unsigned int count = data.toUInt();
|
||||
file->seek(atom->offset() + 16);
|
||||
unsigned int pos = 4;
|
||||
while(count--) {
|
||||
const unsigned int maxPos = data.size() - 8;
|
||||
while(count-- && pos <= maxPos) {
|
||||
long long o = data.toLongLong(pos);
|
||||
if(o > offset)
|
||||
o += delta;
|
||||
|
||||
Reference in New Issue
Block a user