| author | Matt Woodrow <mwoodrow@mozilla.com> |
| Mon, 14 Jul 2014 14:06:16 +1200 | |
| changeset 193756 | dba4eb858d74dcebfe716e47690df69b86079fd9 |
| parent 193755 | 2c95fdd24a270f20c9dd892b12552f834c4ff444 |
| child 193757 | 12b60cc85be1719322b6d1ee5efd6fd8d826c336 |
| push id | 27128 |
| push user | cbook@mozilla.com |
| push date | Mon, 14 Jul 2014 12:35:14 +0000 |
| treeherder | mozilla-central@415c2a4dc778 [default view] [failures only] |
| reviewers | jwatt |
| bugs | 1028802 |
| milestone | 33.0a1 |
| first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
| last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
| gfx/2d/Tools.h | file | annotate | diff | comparison | revisions |
--- a/gfx/2d/Tools.h +++ b/gfx/2d/Tools.h @@ -147,16 +147,22 @@ struct AlignedArray mStorage = nullptr; mPtr = nullptr; mCount = 0; return; } // We don't create an array of T here, since we don't want ctors to be // invoked at the wrong places if we realign below. mStorage = new (std::nothrow) uint8_t[storageByteCount.value()]; + if (!mStorage) { + mStorage = nullptr; + mPtr = nullptr; + mCount = 0; + return; + } if (uintptr_t(mStorage) % alignment) { // Our storage does not start at a <alignment>-byte boundary. Make sure mPtr does! mPtr = (T*)(uintptr_t(mStorage) + alignment - (uintptr_t(mStorage) % alignment)); } else { mPtr = (T*)(mStorage); } // Now that mPtr is pointing to the aligned position we can use placement // |operator new| to invoke any ctors at the correct positions. For types