Fix mp4 parsing failure if CTTS table is empty.
The original code assumes CompositionOffset is always valid and has the same number of samples as other table, which is not true if CTTS table is empty for non-fragmented mp4. Change-Id: If4ecc1159de33202db4ab36df8e32c2a6900daf8
This commit is contained in:
parent
0ccae0d0c9
commit
a725f3fd02
|
@ -176,17 +176,17 @@ bool TrackRunIterator::Init() {
|
||||||
uint32 num_chunks = chunk_offset_vector.size();
|
uint32 num_chunks = chunk_offset_vector.size();
|
||||||
|
|
||||||
// Check that total number of samples match.
|
// Check that total number of samples match.
|
||||||
DCHECK(num_samples == decoding_time.NumSamples() &&
|
DCHECK_EQ(num_samples, decoding_time.NumSamples());
|
||||||
num_samples == composition_offset.NumSamples() &&
|
if (has_composition_offset)
|
||||||
(num_chunks == 0 ||
|
DCHECK_EQ(num_samples, composition_offset.NumSamples());
|
||||||
num_samples == chunk_info.NumSamples(1, num_chunks)) &&
|
if (num_chunks > 0)
|
||||||
num_chunks >= chunk_info.LastFirstChunk());
|
DCHECK_EQ(num_samples, chunk_info.NumSamples(1, num_chunks));
|
||||||
|
DCHECK_GE(num_chunks, chunk_info.LastFirstChunk());
|
||||||
|
|
||||||
if (num_samples > 0) {
|
if (num_samples > 0) {
|
||||||
// Verify relevant tables are not empty.
|
// Verify relevant tables are not empty.
|
||||||
RCHECK(decoding_time.IsValid() &&
|
RCHECK(decoding_time.IsValid());
|
||||||
composition_offset.IsValid() &&
|
RCHECK(chunk_info.IsValid());
|
||||||
chunk_info.IsValid());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 sample_index = 0;
|
uint32 sample_index = 0;
|
||||||
|
|
Loading…
Reference in New Issue