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/trunk@77718 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2014-09-18 00:01:31 +00:00
parent 2db02f4dc2
commit a35527e0e1

View File

@ -1327,6 +1327,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 )