mp4: fix panic on invalid encoding

Fixes #31
This commit is contained in:
David Howden
2018-02-07 18:36:17 +11:00
parent 3066d30077
commit 737d3560dd
+4
View File
@@ -220,6 +220,10 @@ func readCustomAtom(r io.ReadSeeker, size uint32) (string, uint32, error) {
if err != nil {
return "", 0, err
}
if len(b) < 4 {
return "", 0, fmt.Errorf("expected at least %d bytes, got %d", 4, len(b))
}
subNames[subName] = string(b[4:])
case "data":