Merge branch 'image_crash' of https://github.com/Randalphwa/wxWidgets
Don't crash in wxImage::InitAlpha() if it's called on an empty image and avoid calling it in this case. See #24260.
This commit is contained in:
commit
f82ccc1a19
2 changed files with 8 additions and 0 deletions
|
|
@ -2185,6 +2185,8 @@ unsigned char *wxImage::GetAlpha() const
|
|||
|
||||
void wxImage::InitAlpha()
|
||||
{
|
||||
wxCHECK_RET( IsOk(), wxT("invalid image") );
|
||||
|
||||
wxCHECK_RET( !HasAlpha(), wxT("image already has an alpha channel") );
|
||||
|
||||
// initialize memory for alpha channel
|
||||
|
|
|
|||
|
|
@ -167,6 +167,12 @@ void
|
|||
wxImageList::GetImageListBitmaps(wxMSWBitmaps& bitmaps,
|
||||
const wxBitmap& bitmap, const wxBitmap& mask)
|
||||
{
|
||||
if (!bitmap.IsOk())
|
||||
{
|
||||
// We can't do anything with an invalid bitmap.
|
||||
return;
|
||||
}
|
||||
|
||||
// This can be overwritten below if we need to modify the bitmap, but it
|
||||
// doesn't cost anything to initialize the bitmap with this HBITMAP.
|
||||
bitmaps.hbmp = GetHbitmapOf(bitmap);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue