diff --git a/contrib/src/stc/PlatWX.cpp b/contrib/src/stc/PlatWX.cpp index 29535072a7..ae53b19b54 100644 --- a/contrib/src/stc/PlatWX.cpp +++ b/contrib/src/stc/PlatWX.cpp @@ -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); } diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index 29535072a7..ae53b19b54 100644 --- a/src/stc/PlatWX.cpp +++ b/src/stc/PlatWX.cpp @@ -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); }