mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 14:25:52 +00:00
- Make sure memory allocation succeeded
svn path=/trunk/; revision=36043
This commit is contained in:
parent
7fab074623
commit
7260b98dd8
4 changed files with 27 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue