mirror of
https://github.com/reactos/reactos.git
synced 2025-08-08 01:53:01 +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
|
@ -627,6 +627,13 @@ BOOLEAN ScaleRectAvg16(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
||||||
ScanLineAhead = (PIXEL *)ExAllocatePool(PagedPool, (DestRect->right -
|
ScanLineAhead = (PIXEL *)ExAllocatePool(PagedPool, (DestRect->right -
|
||||||
DestRect->left) * sizeof(PIXEL));
|
DestRect->left) * sizeof(PIXEL));
|
||||||
|
|
||||||
|
if (!ScanLine || !ScanLineAhead)
|
||||||
|
{
|
||||||
|
if (ScanLine) ExFreePool(ScanLine);
|
||||||
|
if (ScanLineAhead) ExFreePool(ScanLineAhead);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
DestY = DestRect->top;
|
DestY = DestRect->top;
|
||||||
SpanIndex = 0;
|
SpanIndex = 0;
|
||||||
while (NumPixels-- > 0)
|
while (NumPixels-- > 0)
|
||||||
|
|
|
@ -402,6 +402,13 @@ BOOLEAN ScaleRectAvg32(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
||||||
ScanLine = (PIXEL*)ExAllocatePool(PagedPool, (DestRect->right - DestRect->left) * sizeof(PIXEL));
|
ScanLine = (PIXEL*)ExAllocatePool(PagedPool, (DestRect->right - DestRect->left) * sizeof(PIXEL));
|
||||||
ScanLineAhead = (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;
|
DestY = DestRect->top;
|
||||||
SpanIndex = 0;
|
SpanIndex = 0;
|
||||||
while (NumPixels-- > 0) {
|
while (NumPixels-- > 0) {
|
||||||
|
|
|
@ -387,6 +387,13 @@ BOOLEAN ScaleRectAvg8(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
||||||
ScanLine = (PIXEL*)ExAllocatePool(PagedPool, (DestRect->right - DestRect->left) * sizeof(PIXEL));
|
ScanLine = (PIXEL*)ExAllocatePool(PagedPool, (DestRect->right - DestRect->left) * sizeof(PIXEL));
|
||||||
ScanLineAhead = (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;
|
DestY = DestRect->top;
|
||||||
SpanIndex = 0;
|
SpanIndex = 0;
|
||||||
while (NumPixels-- > 0) {
|
while (NumPixels-- > 0) {
|
||||||
|
|
|
@ -558,8 +558,8 @@ IntPrepareDriver()
|
||||||
if (PrimarySurface.pEDDgpl)
|
if (PrimarySurface.pEDDgpl)
|
||||||
{
|
{
|
||||||
RtlZeroMemory( PrimarySurface.pEDDgpl ,sizeof(EDD_DIRECTDRAW_GLOBAL));
|
RtlZeroMemory( PrimarySurface.pEDDgpl ,sizeof(EDD_DIRECTDRAW_GLOBAL));
|
||||||
}
|
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
|
}
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -963,6 +963,11 @@ IntGdiCreateDisplayDC(HDEV hDev, ULONG DcType, BOOL EmptyDC)
|
||||||
{ // This is a cheesy way to do this.
|
{ // This is a cheesy way to do this.
|
||||||
PDC dc = DC_LockDc ( hDC );
|
PDC dc = DC_LockDc ( hDC );
|
||||||
defaultDCstate = ExAllocatePoolWithTag(PagedPool, sizeof(DC), TAG_DC);
|
defaultDCstate = ExAllocatePoolWithTag(PagedPool, sizeof(DC), TAG_DC);
|
||||||
|
if (!defaultDCstate)
|
||||||
|
{
|
||||||
|
DC_UnlockDc( dc );
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
RtlZeroMemory(defaultDCstate, sizeof(DC));
|
RtlZeroMemory(defaultDCstate, sizeof(DC));
|
||||||
IntGdiCopyToSaveState(dc, defaultDCstate);
|
IntGdiCopyToSaveState(dc, defaultDCstate);
|
||||||
DC_UnlockDc( dc );
|
DC_UnlockDc( dc );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue