Added additional check if source bitmap is valid in wxCairoRenderer::CreateSubBitmap.

Check if source bitmap contains Cairo surface.
This commit is contained in:
Artur Wieczorek 2016-03-24 23:00:07 +01:00
parent cce6f4edaa
commit ab891932cd

View File

@ -2818,6 +2818,8 @@ wxCairoRenderer::CreateSubBitmap(const wxGraphicsBitmap& bitmap,
wxCairoBitmapData* dataSrc = static_cast<wxCairoBitmapData*>(bitmap.GetRefData());
cairo_surface_t* srcSurface = dataSrc->GetCairoSurface();
wxCHECK_MSG(srcSurface, wxNullGraphicsBitmap, wxS("Invalid bitmap"));
int srcWidth = cairo_image_surface_get_width(srcSurface);
int srcHeight = cairo_image_surface_get_height(srcSurface);