mirror of
https://github.com/Open-Shell/Open-Shell-Menu.git
synced 2026-04-18 05:34:51 +10:00
Null check in PremultiplyBitmap()
Blind attempt to eliminate a crash which seems to occur when PremultiplyBitmap() is called after LoadImage() fails. I'm hoping this might fix the issue reported here: https://github.com/Open-Shell/Open-Shell-Menu/issues/400
This commit is contained in:
@@ -332,6 +332,7 @@ HBITMAP BitmapFromIcon( HICON hIcon, int iconSize, unsigned int **pBits, bool bD
|
|||||||
// Premultiplies a DIB section by the alpha channel and a given color
|
// Premultiplies a DIB section by the alpha channel and a given color
|
||||||
void PremultiplyBitmap( HBITMAP hBitmap, COLORREF rgb )
|
void PremultiplyBitmap( HBITMAP hBitmap, COLORREF rgb )
|
||||||
{
|
{
|
||||||
|
if (hBitmap == NULL) return;
|
||||||
BITMAP info;
|
BITMAP info;
|
||||||
GetObject(hBitmap,sizeof(info),&info);
|
GetObject(hBitmap,sizeof(info),&info);
|
||||||
int n=info.bmWidth*info.bmHeight;
|
int n=info.bmWidth*info.bmHeight;
|
||||||
|
|||||||
Reference in New Issue
Block a user