mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 15:52:57 +00:00
[GDI32]
- 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:
parent
c87e532dcb
commit
9b3b1801ed
3 changed files with 13 additions and 10 deletions
|
@ -578,16 +578,13 @@ SetDIBits(
|
||||||
if (!lpvBits || (GDI_HANDLE_GET_TYPE(hBitmap) != GDI_OBJECT_TYPE_BITMAP))
|
if (!lpvBits || (GDI_HANDLE_GET_TYPE(hBitmap) != GDI_OBJECT_TYPE_BITMAP))
|
||||||
return 0;
|
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
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|| lpbmi->bmiHeader.biCompression == BI_PNG)
|
return 0;
|
||||||
{
|
|
||||||
SetLastError(ERROR_INVALID_PARAMETER);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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));
|
strW = HeapAlloc(GetProcessHeap(), 0, lenW*sizeof(WCHAR));
|
||||||
if (!strW)
|
if (!strW)
|
||||||
return NULL;
|
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);
|
DPRINT("mapped %s -> %S\n", str, strW);
|
||||||
if(plenW) *plenW = lenW;
|
if(plenW) *plenW = lenW;
|
||||||
if(pCP) *pCP = cp;
|
if(pCP) *pCP = cp;
|
||||||
|
@ -1009,6 +1013,8 @@ GetGlyphOutlineA(
|
||||||
mbchs[0] = (uChar & 0xff);
|
mbchs[0] = (uChar & 0xff);
|
||||||
}
|
}
|
||||||
p = FONT_mbtowc(hdc, mbchs, len, NULL, NULL);
|
p = FONT_mbtowc(hdc, mbchs, len, NULL, NULL);
|
||||||
|
if(!p)
|
||||||
|
return GDI_ERROR;
|
||||||
c = p[0];
|
c = p[0];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -1096,7 +1096,7 @@ METADC_GetAndSetDCDWord(
|
||||||
|
|
||||||
case GdiGetSetArcDirection:
|
case GdiGetSetArcDirection:
|
||||||
if (GDI_HANDLE_GET_TYPE(physdev->hdc) == GDILoObjType_LO_METADC16_TYPE)
|
if (GDI_HANDLE_GET_TYPE(physdev->hdc) == GDILoObjType_LO_METADC16_TYPE)
|
||||||
pdwResult = 0;
|
*pdwResult = 0;
|
||||||
else
|
else
|
||||||
*pdwResult = physdev->funcs->pSetArcDirection(physdev, dwIn);
|
*pdwResult = physdev->funcs->pSetArcDirection(physdev, dwIn);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue