MP4 atom length is limited up to 31 bits.

32-bit value will be negative.
This commit is contained in:
Tsuda Kageyu 2015-07-31 11:24:36 +09:00
parent f38e32163e
commit c9963af848

View File

@ -27,6 +27,8 @@
#include <config.h>
#endif
#include <climits>
#include <tdebug.h>
#include <tstring.h>
#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 {