From: Vadim Zeitlin Date: Wed, 27 Feb 2008 18:03:12 +0000 (+0000) Subject: don't attempt to create 0*0 bitmaps in GetBuffer() (patch 1899643) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/7c9f643a85d0f6c3e7d5a9270eb57dba750aaef8 don't attempt to create 0*0 bitmaps in GetBuffer() (patch 1899643) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52152 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/dcbufcmn.cpp b/src/common/dcbufcmn.cpp index 4d4083603e..8c6c25b40e 100644 --- a/src/common/dcbufcmn.cpp +++ b/src/common/dcbufcmn.cpp @@ -59,6 +59,14 @@ public: h > ms_buffer->GetHeight() ) { delete ms_buffer; + + // we must always return a valid bitmap but creating a bitmap of + // size 0 would fail, so create a 1*1 bitmap in this case + if ( !w ) + w = 1; + if ( !h ) + h = 1; + ms_buffer = new wxBitmap(w, h); }