diff --git a/packager/media/formats/mp4/box_definitions.cc b/packager/media/formats/mp4/box_definitions.cc index ffbbb032b1..7bc205d276 100644 --- a/packager/media/formats/mp4/box_definitions.cc +++ b/packager/media/formats/mp4/box_definitions.cc @@ -1059,7 +1059,12 @@ bool SampleGroupDescription::ReadWriteEntries(BoxBuffer* buffer, uint32_t count = static_cast(entries->size()); RCHECK(buffer->ReadWriteUInt32(&count)); - RCHECK(count != 0); + if (buffer->Reading()) { + if (count == 0) + return true; + } else { + RCHECK(count != 0); + } entries->resize(count); for (T& entry : *entries) {