fix(isobmff): format issues, again

This commit is contained in:
Tom
2020-02-10 11:35:22 +01:00
committed by GitHub
parent 20a50fd0a2
commit e004d06144

View File

@@ -18,17 +18,17 @@ func IsISOBMFF(buf []byte) bool {
// GetFtyp returns the major brand, minor version and compatible brands of the ISO-BMFF data
func GetFtyp(buf []byte) (string, string, []string) {
if len(buf) < 17 {
return "", "", []string{""}
return "", "", []string{""}
}
ftypLength := binary.BigEndian.Uint32(buf[0:4])
ftypLength := binary.BigEndian.Uint32(buf[0:4])
majorBrand := string(buf[8:12])
minorVersion := string(buf[12:16])
compatibleBrands := []string{}
for i := 16; i < int(ftypLength); i += 4 {
if len(buf) >= (i+4) {
if len(buf) >= (i + 4) {
compatibleBrands = append(compatibleBrands, string(buf[i:i+4]))
}
}