mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 21:20:26 -04:00
MP4: Fix heap-buffer-overflow in mp4properties.cpp (#1058)
This commit is contained in:
parent
4e7f844ea6
commit
f80d11ed2a
@ -188,7 +188,7 @@ MP4::Properties::read(File *file, Atoms *atoms)
|
||||
file->seek(mdhd->offset);
|
||||
data = file->readBlock(mdhd->length);
|
||||
|
||||
const unsigned int version = data[8];
|
||||
const unsigned int version = data.at(8);
|
||||
long long unit;
|
||||
long long length;
|
||||
if(version == 1) {
|
||||
@ -222,13 +222,13 @@ MP4::Properties::read(File *file, Atoms *atoms)
|
||||
d->channels = data.toShort(40U);
|
||||
d->bitsPerSample = data.toShort(42U);
|
||||
d->sampleRate = data.toUInt(46U);
|
||||
if(data.containsAt("esds", 56) && data[64] == 0x03) {
|
||||
if(data.containsAt("esds", 56) && data.at(64) == 0x03) {
|
||||
unsigned int pos = 65;
|
||||
if(data.containsAt("\x80\x80\x80", pos)) {
|
||||
pos += 3;
|
||||
}
|
||||
pos += 4;
|
||||
if(data[pos] == 0x04) {
|
||||
if(data.at(pos) == 0x04) {
|
||||
pos += 1;
|
||||
if(data.containsAt("\x80\x80\x80", pos)) {
|
||||
pos += 3;
|
||||
|
Loading…
Reference in New Issue
Block a user