X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/488194403efc0093d6ae3c6e0c5731b854258805..0bbe61b8c18a1795189f0cf73cc61c14a0fb846d:/src/common/dcbufcmn.cpp?ds=sidebyside 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); }