mkvparser: Cluster::Create clean up.
- Asserts to error condition check and return. - Use nothrow new. Change-Id: Iff9da5806e6f3240e7ea9f9e90ccdf729848a778
This commit is contained in:
@@ -6413,15 +6413,14 @@ long Cluster::GetEntry(long index, const mkvparser::BlockEntry*& pEntry) const {
|
|||||||
return E_BUFFER_NOT_FULL; // underflow, since more remains to be parsed
|
return E_BUFFER_NOT_FULL; // underflow, since more remains to be parsed
|
||||||
}
|
}
|
||||||
|
|
||||||
Cluster* Cluster::Create(Segment* pSegment, long idx, long long off)
|
Cluster* Cluster::Create(Segment* pSegment, long idx, long long off) {
|
||||||
// long long element_size)
|
if (!pSegment || off < 0)
|
||||||
{
|
return NULL;
|
||||||
assert(pSegment);
|
|
||||||
assert(off >= 0);
|
|
||||||
|
|
||||||
const long long element_start = pSegment->m_start + off;
|
const long long element_start = pSegment->m_start + off;
|
||||||
|
|
||||||
Cluster* const pCluster = new Cluster(pSegment, idx, element_start);
|
Cluster* const pCluster =
|
||||||
|
new (std::nothrow) Cluster(pSegment, idx, element_start);
|
||||||
|
|
||||||
return pCluster;
|
return pCluster;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user