Skip to content

Commit c6b1e9c

Browse files
committed
test: test that CoLL and SmDm boxes are handled inside vp09
1 parent 46c061f commit c6b1e9c

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2020
- Lots of fuzzying tests and changes to avoid panic on bad input data
2121
- Support for SMPTE-2086 Mastering Display Metadata Box (SmDm)
2222
- Support for Content Light Level Box (CoLL)
23+
- Test for CoLL and SmDM inside vp09 box
2324

2425
### Fixed
2526

mp4/visualsampleentry.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ type VisualSampleEntryBox struct {
2727
Pasp *PaspBox
2828
Sinf *SinfBox
2929
SmDm *SmDmBox
30+
CoLL *CoLLBox
3031
Children []Box
3132
}
3233

@@ -77,6 +78,8 @@ func (b *VisualSampleEntryBox) AddChild(child Box) {
7778
b.Sinf = box
7879
case *SmDmBox:
7980
b.SmDm = box
81+
case *CoLLBox:
82+
b.CoLL = box
8083
}
8184
b.Children = append(b.Children, child)
8285
}

mp4/vppc.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ func DecodeVppCSR(hdr BoxHeader, startPos uint64, sr bits.SliceReader) (Box, err
7070
if hdr.Size != b.expectedSize(codecInitSize) {
7171
return nil, fmt.Errorf("incorrect box size")
7272
}
73-
b.CodecInitData = sr.ReadBytes(int(codecInitSize))
74-
73+
if codecInitSize != 0 {
74+
b.CodecInitData = sr.ReadBytes(int(codecInitSize))
75+
}
7576
return &b, sr.AccError()
7677
}
7778

0 commit comments

Comments
 (0)