]> granicus.if.org Git - taglib/commitdiff
Minor fix for mp4 media header v0 minimum size check (#895)
authorTim Malseed <t.malseed@gmail.com>
Sun, 17 Mar 2019 13:20:43 +0000 (00:20 +1100)
committerStephen F. Booth <me@sbooth.org>
Sun, 17 Mar 2019 13:20:43 +0000 (08:20 -0500)
Mp4 media header (mdhd) v0 atoms are a minimum of 8 bytes for size & type information, plus 24 bytes for remaining entries (`24 +8`) bytes in total, rather than (`24 + 4`).

See https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-25615

taglib/mp4/mp4properties.cpp

index 4bb4d67b831cd2533e13e64d34097d5767a55b09..e863a3755a1cf6383812892adca3504d6b3a13a3 100644 (file)
@@ -179,7 +179,7 @@ MP4::Properties::read(File *file, Atoms *atoms)
     length = data.toLongLong(36U);
   }
   else {
-    if(data.size() < 24 + 4) {
+    if(data.size() < 24 + 8) {
       debug("MP4: Atom 'trak.mdia.mdhd' is smaller than expected");
       return;
     }