mkvparser: Fix potential overflow in Block::Parse
BUG=b/65045341 Change-Id: I198e72ea3859d2382a34e1e6dca957f9323af278
This commit is contained in:
parent
245e7a258a
commit
86fa6dc2cb
@ -7911,6 +7911,10 @@ long Block::Parse(const Cluster* pCluster) {
|
||||
return E_FILE_FORMAT_INVALID;
|
||||
|
||||
curr.len = static_cast<long>(frame_size);
|
||||
// Check if size + curr.len could overflow.
|
||||
if (size > LLONG_MAX - curr.len) {
|
||||
return E_FILE_FORMAT_INVALID;
|
||||
}
|
||||
size += curr.len; // contribution of this frame
|
||||
|
||||
--frame_count;
|
||||
|
Loading…
x
Reference in New Issue
Block a user