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

Unified Diff: core/src/fxge/ge/fx_ge_ps.cpp

Issue 1135893008: Re-land: Remove FX_Alloc() null checks now that it can't return NULL. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fxge/ge/fx_ge_path.cpp ('k') | core/src/fxge/ge/fx_ge_text.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxge/ge/fx_ge_ps.cpp
diff --git a/core/src/fxge/ge/fx_ge_ps.cpp b/core/src/fxge/ge/fx_ge_ps.cpp
index ad572115c56970cf279b88ea3e72438e2e947fb5..e81b6bf362277d43afb2c4515e69a1c0261d1257 100644
--- a/core/src/fxge/ge/fx_ge_ps.cpp
+++ b/core/src/fxge/ge/fx_ge_ps.cpp
@@ -349,9 +349,6 @@ FX_BOOL CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
int pitch = (width + 7) / 8;
FX_DWORD src_size = height * pitch;
FX_LPBYTE src_buf = FX_Alloc(FX_BYTE, src_size);
- if (!src_buf) {
- return FALSE;
- }
for (int row = 0; row < height; row ++) {
FX_LPCBYTE src_scan = pSource->GetScanline(row);
FXSYS_memcpy32(src_buf + row * pitch, src_scan, pitch);
@@ -425,13 +422,6 @@ FX_BOOL CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource, FX_DWORD color,
int src_pitch = width * Bpp;
output_size = height * src_pitch;
output_buf = FX_Alloc(FX_BYTE, output_size);
- if (!output_buf) {
- if (pConverted != pSource) {
- delete pConverted;
- pConverted = NULL;
- }
- return FALSE;
- }
for (int row = 0; row < height; row ++) {
FX_LPCBYTE src_scan = pConverted->GetScanline(row);
FX_LPBYTE dest_scan = output_buf + row * src_pitch;
« no previous file with comments | « core/src/fxge/ge/fx_ge_path.cpp ('k') | core/src/fxge/ge/fx_ge_text.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698