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

Side by Side Diff: core/src/fxge/ge/fx_ge_ps.cpp

Issue 1297713003: Don't bother checking pointers before delete[] and FX_Free(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 5 years, 4 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/ge/fx_ge_path.cpp ('k') | core/src/fxge/win32/fx_win32_device.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_ge.h" 7 #include "../../../include/fxge/fx_ge.h"
8 #include "../../../include/fxcodec/fx_codec.h" 8 #include "../../../include/fxcodec/fx_codec.h"
9 #include "text_int.h" 9 #include "text_int.h"
10 struct PSGlyph { 10 struct PSGlyph {
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 pEncoders->GetBasicModule()->RunLengthEncode(src_buf, src_size, 315 pEncoders->GetBasicModule()->RunLengthEncode(src_buf, src_size,
316 dest_buf, dest_size)) { 316 dest_buf, dest_size)) {
317 filter = "/RunLengthDecode filter "; 317 filter = "/RunLengthDecode filter ";
318 } 318 }
319 } 319 }
320 if (dest_size < src_size) { 320 if (dest_size < src_size) {
321 output_buf = dest_buf; 321 output_buf = dest_buf;
322 output_size = dest_size; 322 output_size = dest_size;
323 } else { 323 } else {
324 filter = NULL; 324 filter = NULL;
325 if (dest_buf) { 325 FX_Free(dest_buf);
326 FX_Free(dest_buf);
327 }
328 } 326 }
329 } 327 }
330 FX_BOOL CFX_PSRenderer::SetDIBits(const CFX_DIBSource* pSource, 328 FX_BOOL CFX_PSRenderer::SetDIBits(const CFX_DIBSource* pSource,
331 FX_DWORD color, 329 FX_DWORD color,
332 int left, 330 int left,
333 int top, 331 int top,
334 int alpha_flag, 332 int alpha_flag,
335 void* pIccTransform) { 333 void* pIccTransform) {
336 StartRendering(); 334 StartRendering();
337 CFX_AffineMatrix matrix((FX_FLOAT)(pSource->GetWidth()), 0.0f, 0.0f, 335 CFX_AffineMatrix matrix((FX_FLOAT)(pSource->GetWidth()), 0.0f, 0.0f,
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 FX_DWORD dest_size; 707 FX_DWORD dest_size;
710 CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule(); 708 CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule();
711 if (pEncoders && 709 if (pEncoders &&
712 pEncoders->GetBasicModule()->A85Encode(data, len, dest_buf, dest_size)) { 710 pEncoders->GetBasicModule()->A85Encode(data, len, dest_buf, dest_size)) {
713 m_pOutput->OutputPS((const FX_CHAR*)dest_buf, dest_size); 711 m_pOutput->OutputPS((const FX_CHAR*)dest_buf, dest_size);
714 FX_Free(dest_buf); 712 FX_Free(dest_buf);
715 } else { 713 } else {
716 m_pOutput->OutputPS((const FX_CHAR*)data, len); 714 m_pOutput->OutputPS((const FX_CHAR*)data, len);
717 } 715 }
718 } 716 }
OLDNEW
« no previous file with comments | « core/src/fxge/ge/fx_ge_path.cpp ('k') | core/src/fxge/win32/fx_win32_device.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698