From d6443e65ee3016ced52e4baf7ac81bca1fb7bb25 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 4 Apr 2021 20:59:00 +0200 Subject: [PATCH] Don't store negative dimensions for images in wxImageList --- src/msw/imaglist.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/msw/imaglist.cpp b/src/msw/imaglist.cpp index e7a3285373..373dacb088 100644 --- a/src/msw/imaglist.cpp +++ b/src/msw/imaglist.cpp @@ -73,7 +73,8 @@ wxImageList::wxImageList() // Creates an image list bool wxImageList::Create(int width, int height, bool mask, int initial) { - m_size = wxSize(width, height); + // Prevent from storing negative dimensions + m_size = wxSize(wxMax(width, 0), wxMax(height, 0)); UINT flags = 0; // as we want to be able to use 32bpp bitmaps in the image lists, we always