]> granicus.if.org Git - taglib/commitdiff
Another workaround for broken MPEG headers.
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Thu, 7 Jan 2016 17:30:17 +0000 (02:30 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Thu, 7 Jan 2016 17:30:17 +0000 (02:30 +0900)
taglib/mpeg/mpegutils.h

index 78cee280276ff3123a15e9a93f1f6e81bbc4a783..5a7e0e6a8d37d8d7a2b4615174705f4c974627d4 100644 (file)
@@ -48,7 +48,9 @@ namespace TagLib
 
     inline bool secondSynchByte(unsigned char byte)
     {
-      return ((byte & 0xE0) == 0xE0);
+      // 0xFF is possible in theory, but it's very unlikely be a header.
+
+      return (byte != 0xFF && ((byte & 0xE0) == 0xE0));
     }
 
   }