X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6efc1b30d6ecd3dbae05a562a40ce48d3c3b5f7b..fe828a03f46181cc172bf61739fe09a043f73aea:/src/common/dcbufcmn.cpp 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); }