Don't fail if input contents contain SampleGroupDescriptionBox with 0 entries
Fixes #812.
This commit is contained in:
parent
5c91e54b8b
commit
6298f49d9e
|
@ -1059,7 +1059,12 @@ bool SampleGroupDescription::ReadWriteEntries(BoxBuffer* buffer,
|
||||||
|
|
||||||
uint32_t count = static_cast<uint32_t>(entries->size());
|
uint32_t count = static_cast<uint32_t>(entries->size());
|
||||||
RCHECK(buffer->ReadWriteUInt32(&count));
|
RCHECK(buffer->ReadWriteUInt32(&count));
|
||||||
|
if (buffer->Reading()) {
|
||||||
|
if (count == 0)
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
RCHECK(count != 0);
|
RCHECK(count != 0);
|
||||||
|
}
|
||||||
entries->resize(count);
|
entries->resize(count);
|
||||||
|
|
||||||
for (T& entry : *entries) {
|
for (T& entry : *entries) {
|
||||||
|
|
Loading…
Reference in New Issue