Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(468)

Side by Side Diff: core/src/fxge/dib/fx_dib_engine.cpp

Issue 1143663008: Merge to XFA: Remove FX_Alloc() null checks now that it can't return NULL. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Rebased. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/src/fxge/dib/fx_dib_convert.cpp ('k') | core/src/fxge/dib/fx_dib_main.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "../../../include/fxge/fx_dib.h" 7 #include "../../../include/fxge/fx_dib.h"
8 #include "../../../include/fxge/fx_ge.h" 8 #include "../../../include/fxge/fx_ge.h"
9 #include "dib_int.h" 9 #include "dib_int.h"
10 #include <limits.h> 10 #include <limits.h>
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 m_bFlipY = TRUE; 792 m_bFlipY = TRUE;
793 m_DestHeight = -m_DestHeight; 793 m_DestHeight = -m_DestHeight;
794 } 794 }
795 m_LineIndex = 0; 795 m_LineIndex = 0;
796 FX_DWORD size = m_ClipRect.Width(); 796 FX_DWORD size = m_ClipRect.Width();
797 if (size && m_DestBPP > (int)(INT_MAX / size)) { 797 if (size && m_DestBPP > (int)(INT_MAX / size)) {
798 return FALSE; 798 return FALSE;
799 } 799 }
800 size *= m_DestBPP; 800 size *= m_DestBPP;
801 m_pScanline = FX_Alloc(FX_BYTE, (size / 8 + 3) / 4 * 4); 801 m_pScanline = FX_Alloc(FX_BYTE, (size / 8 + 3) / 4 * 4);
802 if (!m_pScanline) {
803 return FALSE;
804 }
805 if (m_pSource->m_pAlphaMask) { 802 if (m_pSource->m_pAlphaMask) {
806 m_pMaskScanline = FX_Alloc(FX_BYTE, (m_ClipRect.Width() + 3) / 4 * 4); 803 m_pMaskScanline = FX_Alloc(FX_BYTE, (m_ClipRect.Width() + 3) / 4 * 4);
807 if (!m_pMaskScanline) {
808 return FALSE;
809 }
810 } 804 }
811 if (m_pSource->GetWidth() * m_pSource->GetHeight() < MAX_PROGRESSIVE_STRETCH _PIXELS) { 805 if (m_pSource->GetWidth() * m_pSource->GetHeight() < MAX_PROGRESSIVE_STRETCH _PIXELS) {
812 ContinueQuickStretch(NULL); 806 ContinueQuickStretch(NULL);
813 return FALSE; 807 return FALSE;
814 } 808 }
815 return TRUE; 809 return TRUE;
816 } 810 }
817 FX_BOOL CFX_ImageStretcher::ContinueQuickStretch(IFX_Pause* pPause) 811 FX_BOOL CFX_ImageStretcher::ContinueQuickStretch(IFX_Pause* pPause)
818 { 812 {
819 if (m_pScanline == NULL) { 813 if (m_pScanline == NULL) {
(...skipping 20 matching lines...) Expand all
840 return TRUE; 834 return TRUE;
841 } 835 }
842 m_pSource->DownSampleScanline(src_y, m_pScanline, m_DestBPP, m_DestWidth , m_bFlipX, m_ClipRect.left, result_width); 836 m_pSource->DownSampleScanline(src_y, m_pScanline, m_DestBPP, m_DestWidth , m_bFlipX, m_ClipRect.left, result_width);
843 if (m_pMaskScanline) { 837 if (m_pMaskScanline) {
844 m_pSource->m_pAlphaMask->DownSampleScanline(src_y, m_pMaskScanline, 1, m_DestWidth, m_bFlipX, m_ClipRect.left, result_width); 838 m_pSource->m_pAlphaMask->DownSampleScanline(src_y, m_pMaskScanline, 1, m_DestWidth, m_bFlipX, m_ClipRect.left, result_width);
845 } 839 }
846 m_pDest->ComposeScanline(dest_y, m_pScanline, m_pMaskScanline); 840 m_pDest->ComposeScanline(dest_y, m_pScanline, m_pMaskScanline);
847 } 841 }
848 return FALSE; 842 return FALSE;
849 } 843 }
OLDNEW
« no previous file with comments | « core/src/fxge/dib/fx_dib_convert.cpp ('k') | core/src/fxge/dib/fx_dib_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698