- Make sure memory allocation succeeded

svn path=/trunk/; revision=36043
This commit is contained in:
Cameron Gutman 2008-09-07 22:28:19 +00:00
parent 7fab074623
commit 7260b98dd8
4 changed files with 27 additions and 1 deletions

View file

@ -626,6 +626,13 @@ BOOLEAN ScaleRectAvg16(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
ScanLineAhead = (PIXEL *)ExAllocatePool(PagedPool, (DestRect->right -
DestRect->left) * sizeof(PIXEL));
if (!ScanLine || !ScanLineAhead)
{
if (ScanLine) ExFreePool(ScanLine);
if (ScanLineAhead) ExFreePool(ScanLineAhead);
return FALSE;
}
DestY = DestRect->top;
SpanIndex = 0;

View file

@ -402,6 +402,13 @@ BOOLEAN ScaleRectAvg32(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
ScanLine = (PIXEL*)ExAllocatePool(PagedPool, (DestRect->right - DestRect->left) * sizeof(PIXEL));
ScanLineAhead = (PIXEL *)ExAllocatePool(PagedPool, (DestRect->right - DestRect->left) * sizeof(PIXEL));
if (!ScanLine || !ScanLineAhead)
{
if (ScanLine) ExFreePool(ScanLine);
if (ScanLineAhead) ExFreePool(ScanLineAhead);
return FALSE;
}
DestY = DestRect->top;
SpanIndex = 0;
while (NumPixels-- > 0) {

View file

@ -387,6 +387,13 @@ BOOLEAN ScaleRectAvg8(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
ScanLine = (PIXEL*)ExAllocatePool(PagedPool, (DestRect->right - DestRect->left) * sizeof(PIXEL));
ScanLineAhead = (PIXEL *)ExAllocatePool(PagedPool, (DestRect->right - DestRect->left) * sizeof(PIXEL));
if (!ScanLine || !ScanLineAhead)
{
if (ScanLine) ExFreePool(ScanLine);
if (ScanLineAhead) ExFreePool(ScanLineAhead);
return FALSE;
}
DestY = DestRect->top;
SpanIndex = 0;
while (NumPixels-- > 0) {

View file

@ -558,8 +558,8 @@ IntPrepareDriver()
if (PrimarySurface.pEDDgpl)
{
RtlZeroMemory( PrimarySurface.pEDDgpl ,sizeof(EDD_DIRECTDRAW_GLOBAL));
ret = TRUE;
}
ret = TRUE;
goto cleanup;
}
@ -963,6 +963,11 @@ IntGdiCreateDisplayDC(HDEV hDev, ULONG DcType, BOOL EmptyDC)
{ // This is a cheesy way to do this.
PDC dc = DC_LockDc ( hDC );
defaultDCstate = ExAllocatePoolWithTag(PagedPool, sizeof(DC), TAG_DC);
if (!defaultDCstate)
{
DC_UnlockDc( dc );
return NULL;
}
RtlZeroMemory(defaultDCstate, sizeof(DC));
IntGdiCopyToSaveState(dc, defaultDCstate);
DC_UnlockDc( dc );