Skip to content

Commit

Permalink
fix(isobmff): format issues, again
Browse files Browse the repository at this point in the history
  • Loading branch information
h2non authored Feb 10, 2020
1 parent 20a50fd commit e004d06
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions matchers/isobmff/isobmff.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]))
}
}
Expand Down

0 comments on commit e004d06

Please sign in to comment.