From c9963af848ed3e9b4f34ea976045deb351fa39ef Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu Date: Fri, 31 Jul 2015 11:24:36 +0900 Subject: [PATCH] MP4 atom length is limited up to 31 bits. 32-bit value will be negative. --- taglib/mp4/mp4atom.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/taglib/mp4/mp4atom.cpp b/taglib/mp4/mp4atom.cpp index b12f9459..bd9c7b16 100644 --- a/taglib/mp4/mp4atom.cpp +++ b/taglib/mp4/mp4atom.cpp @@ -27,6 +27,8 @@ #include #endif +#include + #include #include #include "mp4atom.h" @@ -60,8 +62,8 @@ MP4::Atom::Atom(File *file) length = longLength; } else { - if(longLength <= 0xFFFFFFFF) { - // The atom has a 64-bit length, but it's actually a 32-bit value + if(longLength <= LONG_MAX) { + // The atom has a 64-bit length, but it's actually a 31-bit value length = (long)longLength; } else {