Bug 1345179 - use MakeUniqueFallible() in BlankVideoDataCreator; r=jwwang

If OOM happends, just return null and the DummyMediaDataDecoder will reject the DecodePromise with NS_ERROR_OUT_OF_MEMORY.

MozReview-Commit-ID: H6sTyoQWZk5

--HG--
extra : rebase_source : 5046a68978b817db8f1191e1f56e80ec5848899c
This commit is contained in:
Kaku Kuo 2017-03-16 12:09:23 +08:00
parent 45d09e0952
commit 642536ba3b

View File

@ -5,7 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/CheckedInt.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/UniquePtrExtensions.h"
#include "mozilla/RefPtr.h"
#include "nsRect.h"
#include "nsSize.h"
@ -37,7 +37,10 @@ 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 = MakeUnique<uint8_t[]>(mFrameWidth * mFrameHeight);
auto frame = MakeUniqueFallible<uint8_t[]>(mFrameWidth * mFrameHeight);
if (!frame) {
return nullptr;
}
memset(frame.get(), 0, mFrameWidth * mFrameHeight);
VideoData::YCbCrBuffer buffer;