Bug 722444. Initialize mData for 0 sized surfaces. r=bgirard

This avoids an invalid free() during destruction found with the
online canvas test suite.

--HG--
extra : rebase_source : e1aeff36e557b045fbaff38d7b46fdf91956ae49
This commit is contained in:
Jeff Muizelaar 2012-01-30 11:17:42 -05:00
parent 33ac1e18fe
commit c6a61d7d9a

View File

@ -795,6 +795,7 @@ DrawTargetCG::Init(CGContextRef cgContext, const IntSize &aSize)
if (aSize.width == 0 || aSize.height == 0) {
mColorSpace = NULL;
mCg = NULL;
mData = NULL;
return false;
}
@ -829,6 +830,7 @@ DrawTargetCG::Init(const IntSize &aSize, SurfaceFormat &)
if (aSize.width == 0 || aSize.height == 0) {
mColorSpace = NULL;
mCg = NULL;
mData = NULL;
return false;
}