Bug 982475 - Prevent SwapRAndBComponents derefencing NULL pointer. r=jgilbert

This commit is contained in:
Dan Glastonbury 2014-03-11 11:01:00 +10:00
parent b2f5789c43
commit 0380da9a54

View File

@ -209,6 +209,10 @@ GetActualReadFormats(GLContext* gl,
static void SwapRAndBComponents(DataSourceSurface* surf)
{
uint8_t *row = surf->GetData();
if (!row) {
MOZ_ASSERT(false, "SwapRAndBComponents: Failed to get data from DataSourceSurface.");
return;
}
size_t rowBytes = surf->GetSize().width*4;
size_t rowHole = surf->Stride() - rowBytes;