Don't fail if input contents contain SampleGroupDescriptionBox with 0 entries

Fixes #812.
This commit is contained in:
akata01 2020-08-10 01:44:16 +00:00 committed by GitHub
parent 5c91e54b8b
commit 6298f49d9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -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) {