Fix crash when creating wxGraphicsBitmap from cairo_surface_t.

Initialize m_buffer to avoid crashes when deleting it in Cairo-based
wxGraphicsContext implementation for bitmaps created from the native ones.

Don't leave the bitmap size uninitialized neither, this might not result in
crashes, but is definitely wrong as well.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77720 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-09-18 00:02:59 +00:00
parent 228ecaad8b
commit 96441d17f6

View File

@@ -1316,6 +1316,10 @@ wxCairoBitmapData::wxCairoBitmapData( wxGraphicsRenderer* renderer, cairo_surfac
{
m_surface = bitmap;
m_pattern = cairo_pattern_create_for_surface(m_surface);
m_width = cairo_image_surface_get_width(m_surface);
m_height = cairo_image_surface_get_height(m_surface);
m_buffer = NULL;
}
wxCairoBitmapData::wxCairoBitmapData( wxGraphicsRenderer* renderer, const wxBitmap& bmp ) : wxGraphicsBitmapData( renderer )