]> granicus.if.org Git - taglib/commitdiff
MP4 atom length is limited up to 31 bits.
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Fri, 31 Jul 2015 02:24:36 +0000 (11:24 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Fri, 31 Jul 2015 02:24:36 +0000 (11:24 +0900)
32-bit value will be negative.

taglib/mp4/mp4atom.cpp

index b12f94599b50409fc45c14c053fea97915e1cd8a..bd9c7b1695986a993a285b67e7dd992a219563b2 100644 (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 {