Bug 589891 - d2d 0-sized surfaces shouldn't cause a Cxx exception. r=jmuizelaar, a2.0=blocking-beta5

This commit is contained in:
Vladimir Vukicevic 2010-08-23 20:12:11 -07:00
Родитель f506421a9e
Коммит 4f67542ae9
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -3431,6 +3431,10 @@ cairo_d2d_surface_create(cairo_device_t *device,
int width,
int height)
{
if (width == 0 || height == 0) {
return _cairo_surface_create_in_error(_cairo_error(CAIRO_STATUS_INVALID_SIZE));
}
cairo_d2d_device_t *d2d_device = reinterpret_cast<cairo_d2d_device_t*>(device);
cairo_d2d_surface_t *newSurf = static_cast<cairo_d2d_surface_t*>(malloc(sizeof(cairo_d2d_surface_t)));
new (newSurf) cairo_d2d_surface_t();