зеркало из https://github.com/mozilla/pjs.git
Bug 682615 - Use fallible new for BasicPlanarYCbCrImage. r=roc
This commit is contained in:
Родитель
b4dde5a66c
Коммит
0c8db7cb1e
|
@ -452,6 +452,11 @@ public:
|
|||
PRUint8 *CopyData(Data& aDest, gfxIntSize& aDestSize,
|
||||
PRUint32& aDestBufferSize, const Data& aData);
|
||||
|
||||
/**
|
||||
* Return a buffer to store image data in.
|
||||
* The default implementation returns memory that can
|
||||
* be freed wit delete[]
|
||||
*/
|
||||
virtual PRUint8* AllocateBuffer(PRUint32 aSize);
|
||||
|
||||
/**
|
||||
|
|
|
@ -206,7 +206,7 @@ BasicPlanarYCbCrImage::SetData(const Data& aData)
|
|||
prescale ? mScaleHint.height : aData.mPicSize.height);
|
||||
|
||||
mStride = gfxASurface::FormatStrideForWidth(format, size.width);
|
||||
mBuffer = new PRUint8[size.height * mStride];
|
||||
mBuffer = AllocateBuffer(size.height * mStride);
|
||||
if (!mBuffer) {
|
||||
// out of memory
|
||||
return;
|
||||
|
|
Загрузка…
Ссылка в новой задаче