Bug 1127554 - Do a fallible allocation in SampleIterator::GetNext. v1 r=mattwoodrow

This commit is contained in:
Bobby Holley 2015-02-11 15:25:26 -08:00
parent ced4bbc434
commit 2cd7434422

View File

@ -100,7 +100,10 @@ MP4Sample* SampleIterator::GetNext()
sample->size = s->mByteRange.Length();
// Do the blocking read
sample->data = sample->extra_buffer = new uint8_t[sample->size];
sample->data = sample->extra_buffer = new (fallible) uint8_t[sample->size];
if (!sample->data) {
return nullptr;
}
size_t bytesRead;
if (!mIndex->mSource->ReadAt(sample->byte_offset, sample->data, sample->size,