]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/stc/PlatWX.cpp
Don't create a bitmap with dimensions <= 0...
[wxWidgets.git] / contrib / src / stc / PlatWX.cpp
index 29535072a7ae4ce72829327ddb500636b1e316b1..ae53b19b54a3822976b6945faaaf13c0cedb25cf 100644 (file)
@@ -174,6 +174,8 @@ void Surface::InitPixMap(int width, int height, Surface *surface_) {
     Release();
     hdc = new wxMemoryDC(surface_->hdc);
     hdcOwned = true;
+    if (width < 1) width = 1;
+    if (height < 1) height = 1;
     bitmap = new wxBitmap(width, height);
     ((wxMemoryDC*)hdc)->SelectObject(*bitmap);
 }