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:
rkagerer
2020-07-12 10:33:45 -07:00
committed by ge0rdi
parent fcf95a3ea6
commit 473f7e1445

View File

@@ -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
void PremultiplyBitmap( HBITMAP hBitmap, COLORREF rgb )
{
if (hBitmap == NULL) return;
BITMAP info;
GetObject(hBitmap,sizeof(info),&info);
int n=info.bmWidth*info.bmHeight;