AlphaMask: add missing error check.

It's possible to allocate the bitmap object, then fail allocating the
bits. The WebKit testsuite is a way to trigger this, and it crashed
app_server.
This commit is contained in:
Adrien Destugues 2014-05-26 17:23:34 +02:00
parent 34b9ff37b4
commit 36764b4001

View File

@ -178,6 +178,11 @@ AlphaMask::_RenderPicture() const
if (bitmap == NULL)
return NULL;
if (!bitmap->IsValid()) {
delete bitmap;
return NULL;
}
// Clear the bitmap with the transparent color
memset(bitmap->Bits(), 0, bitmap->BitsLength());