- Fix a possible null pointer dereference in GetGlyphOutlineA. CID 513747
- SetDIBits should not accept null bitmap info at all. CID 513425
- Don't set the pdwResult pointer itself to null in TADC_GetAndSetDCDWord. CID 1321970

svn path=/trunk/; revision=73877
This commit is contained in:
Kamil Hornicek 2017-02-22 10:22:28 +00:00
parent c87e532dcb
commit 9b3b1801ed
3 changed files with 13 additions and 10 deletions

View file

@ -578,16 +578,13 @@ SetDIBits(
if (!lpvBits || (GDI_HANDLE_GET_TYPE(hBitmap) != GDI_OBJECT_TYPE_BITMAP))
return 0;
if (lpbmi)
if (lpbmi->bmiHeader.biSize >= sizeof(BITMAPINFOHEADER))
{
if (lpbmi->bmiHeader.biSize >= sizeof(BITMAPINFOHEADER))
if (lpbmi->bmiHeader.biCompression == BI_JPEG
|| lpbmi->bmiHeader.biCompression == BI_PNG)
{
if (lpbmi->bmiHeader.biCompression == BI_JPEG
|| lpbmi->bmiHeader.biCompression == BI_PNG)
{
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
}

View file

@ -132,7 +132,11 @@ static LPWSTR FONT_mbtowc(HDC hdc, LPCSTR str, INT count, INT *plenW, UINT *pCP)
strW = HeapAlloc(GetProcessHeap(), 0, lenW*sizeof(WCHAR));
if (!strW)
return NULL;
MultiByteToWideChar(cp, 0, str, count, strW, lenW);
if(!MultiByteToWideChar(cp, 0, str, count, strW, lenW))
{
HeapFree(GetProcessHeap(), 0, strW);
return NULL;
}
DPRINT("mapped %s -> %S\n", str, strW);
if(plenW) *plenW = lenW;
if(pCP) *pCP = cp;
@ -1009,6 +1013,8 @@ GetGlyphOutlineA(
mbchs[0] = (uChar & 0xff);
}
p = FONT_mbtowc(hdc, mbchs, len, NULL, NULL);
if(!p)
return GDI_ERROR;
c = p[0];
}
else

View file

@ -1096,7 +1096,7 @@ METADC_GetAndSetDCDWord(
case GdiGetSetArcDirection:
if (GDI_HANDLE_GET_TYPE(physdev->hdc) == GDILoObjType_LO_METADC16_TYPE)
pdwResult = 0;
*pdwResult = 0;
else
*pdwResult = physdev->funcs->pSetArcDirection(physdev, dwIn);
break;