X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6efc1b30d6ecd3dbae05a562a40ce48d3c3b5f7b..55cd5d10cd919f9cd50f9e9403f5f74a03c6f057:/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); }