From 994bc961e776d1636f46271f2a5031aea9474ff7 Mon Sep 17 00:00:00 2001 From: Randalphwa <38287198+Randalphwa@users.noreply.github.com> Date: Sat, 27 Jan 2024 11:51:33 -0800 Subject: [PATCH] InitAlpha() --avoid crash if empty/invalid --- src/common/image.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/common/image.cpp b/src/common/image.cpp index 98037f9c39..51a93e108e 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -2185,6 +2185,9 @@ unsigned char *wxImage::GetAlpha() const void wxImage::InitAlpha() { + if (!IsOk()) + return; + wxCHECK_RET( !HasAlpha(), wxT("image already has an alpha channel") ); // initialize memory for alpha channel