From bf4aa2cc93a67826247e887b2ba26a1b965eb616 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 19 May 2015 14:56:52 -0700 Subject: Revert "Remove FX_Alloc() null checks now that it can't return NULL." This reverts commit eb6527763171cdb4b0fbfea5a20d691f4d67b660. Reason for revert: broke javascript tests. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1145843005 --- core/src/fxge/dib/fx_dib_engine.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'core/src/fxge/dib/fx_dib_engine.cpp') diff --git a/core/src/fxge/dib/fx_dib_engine.cpp b/core/src/fxge/dib/fx_dib_engine.cpp index b486def167..7c40171c2b 100644 --- a/core/src/fxge/dib/fx_dib_engine.cpp +++ b/core/src/fxge/dib/fx_dib_engine.cpp @@ -796,8 +796,14 @@ FX_BOOL CFX_ImageStretcher::StartQuickStretch() } size *= m_DestBPP; m_pScanline = FX_Alloc(FX_BYTE, (size / 8 + 3) / 4 * 4); + if (!m_pScanline) { + return FALSE; + } if (m_pSource->m_pAlphaMask) { m_pMaskScanline = FX_Alloc(FX_BYTE, (m_ClipRect.Width() + 3) / 4 * 4); + if (!m_pMaskScanline) { + return FALSE; + } } if (m_pSource->GetWidth() * m_pSource->GetHeight() < MAX_PROGRESSIVE_STRETCH_PIXELS) { ContinueQuickStretch(NULL); -- cgit v1.2.3