]> granicus.if.org Git - taglib/commitdiff
Remove a useless branch.
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Tue, 1 Nov 2016 07:03:15 +0000 (16:03 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Tue, 1 Nov 2016 07:03:15 +0000 (16:03 +0900)
longLength <= LONG_MAX is always true if sizeof(long) == sizeof(long long).

taglib/mp4/mp4atom.cpp

index 6ea0cb62cbe386c844ed634850700125b64e85b6..5758173bcf98acd9704dc84a850e69060ab5cb9d 100644 (file)
@@ -56,20 +56,15 @@ MP4::Atom::Atom(File *file)
 
   if(length == 1) {
     const long long longLength = file->readBlock(8).toLongLong();
-    if(sizeof(long) == sizeof(long long)) {
+    if(longLength <= LONG_MAX) {
+      // The atom has a 64-bit length, but it's actually a 31-bit value or long is 64-bit.
       length = static_cast<long>(longLength);
     }
     else {
-      if(longLength <= LONG_MAX) {
-        // The atom has a 64-bit length, but it's actually a 31-bit value
-        length = static_cast<long>(longLength);
-      }
-      else {
-        debug("MP4: 64-bit atoms are not supported");
-        length = 0;
-        file->seek(0, File::End);
-        return;
-      }
+      debug("MP4: 64-bit atoms are not supported");
+      length = 0;
+      file->seek(0, File::End);
+      return;
     }
   }
   if(length < 8) {