[USER32] Add ICO_ExtractIconExW RetPtr NULL check (#2149)

CORE-16557
This commit is contained in:
Katayama Hirofumi MZ 2019-12-16 20:37:23 +09:00 committed by GitHub
parent 23147330dd
commit 2af9e7dfac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -469,17 +469,20 @@ static UINT ICO_ExtractIconExW(
icon = CreateIconFromResourceEx(imageData, entry->icHeader.biSizeImage, sig == 1, 0x00030000, cx[index], cy[index], flags); icon = CreateIconFromResourceEx(imageData, entry->icHeader.biSizeImage, sig == 1, 0x00030000, cx[index], cy[index], flags);
HeapFree(GetProcessHeap(), 0, cursorData);
if (icon) if (icon)
{ {
RetPtr[index] = icon; if (RetPtr)
iconCount = 1; RetPtr[index] = icon;
} else
DestroyIcon(icon);
if(cursorData != NULL) iconCount = 1;
HeapFree(GetProcessHeap(), 0, cursorData); break;
}
} }
} }
} }
ret = iconCount; /* return number of retrieved icons */ ret = iconCount; /* return number of retrieved icons */
} }