Bug 1138992: P1. Ignore ctts version if we have 0 samples in the table. r=kentuckyfriedtakahe

This commit is contained in:
Jean-Yves Avenard 2015-09-21 11:46:39 +10:00
parent 8f26a80ce8
commit fd7fa9c3ac

View File

@ -388,13 +388,13 @@ status_t SampleTable::setCompositionTimeToSampleParams(
return ERROR_IO; return ERROR_IO;
} }
if (U32_AT(header) != 0) { uint32_t numEntries = U32_AT(&header[4]);
if (U32_AT(header) != 0 && numEntries) {
// Expected version = 0, flags = 0. // Expected version = 0, flags = 0.
return ERROR_MALFORMED; return ERROR_MALFORMED;
} }
uint32_t numEntries = U32_AT(&header[4]);
if (data_size != ((uint64_t)numEntries + 1) * 8) { if (data_size != ((uint64_t)numEntries + 1) * 8) {
return ERROR_MALFORMED; return ERROR_MALFORMED;
} }