mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-28 04:35:33 +00:00
Bug 1348237 part 1 - prevent overflow in BlankVideoDataCreater; r=jwwang
MozReview-Commit-ID: D5BZIfpZjD3 --HG-- extra : rebase_source : 263394e6057415551e9eb36bc3c74daa33a93c30
This commit is contained in:
parent
a01488052d
commit
c819daf588
@ -37,7 +37,12 @@ public:
|
||||
// with a U and V plane that are half the size of the Y plane, i.e 8 bit,
|
||||
// 2x2 subsampled. Have the data pointer of each frame point to the
|
||||
// first plane, they'll always be zero'd memory anyway.
|
||||
auto frame = MakeUniqueFallible<uint8_t[]>(mFrameWidth * mFrameHeight);
|
||||
const CheckedUint32 size = CheckedUint32(mFrameWidth) * mFrameHeight;
|
||||
if (!size.isValid()) {
|
||||
// Overflow happened.
|
||||
return nullptr;
|
||||
}
|
||||
auto frame = MakeUniqueFallible<uint8_t[]>(size.value());
|
||||
if (!frame) {
|
||||
return nullptr;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user