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

Side by Side Diff: core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp

Issue 1145843005: Revert "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 unified diff | Download patch
« no previous file with comments | « core/include/fxge/fx_ge.h ('k') | core/src/fpdfapi/fpdf_edit/fpdf_edit_image.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/fpdfapi/fpdf_serial.h" 7 #include "../../../include/fpdfapi/fpdf_serial.h"
8 #include "editint.h" 8 #include "editint.h"
9 #define PDF_OBJECTSTREAM_MAXLENGTH (256 * 1024) 9 #define PDF_OBJECTSTREAM_MAXLENGTH (256 * 1024)
10 #define PDF_XREFSTREAM_MAXSIZE 10000 10 #define PDF_XREFSTREAM_MAXSIZE 10000
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 return TRUE; 408 return TRUE;
409 } 409 }
410 if (pHandler == NULL) { 410 if (pHandler == NULL) {
411 m_pData = (FX_LPBYTE)src_data; 411 m_pData = (FX_LPBYTE)src_data;
412 m_dwSize = src_size; 412 m_dwSize = src_size;
413 m_bNewBuf = FALSE; 413 m_bNewBuf = FALSE;
414 return TRUE; 414 return TRUE;
415 } 415 }
416 m_dwSize = pHandler->EncryptGetSize(objnum, 0, src_data, src_size); 416 m_dwSize = pHandler->EncryptGetSize(objnum, 0, src_data, src_size);
417 m_pData = FX_Alloc(FX_BYTE, m_dwSize); 417 m_pData = FX_Alloc(FX_BYTE, m_dwSize);
418 if(!m_pData) {
419 return FALSE;
420 }
418 pHandler->EncryptContent(objnum, 0, src_data, src_size, m_pData, m_dwSize); 421 pHandler->EncryptContent(objnum, 0, src_data, src_size, m_pData, m_dwSize);
419 m_bNewBuf = TRUE; 422 m_bNewBuf = TRUE;
420 return TRUE; 423 return TRUE;
421 } 424 }
422 CPDF_Encryptor::~CPDF_Encryptor() 425 CPDF_Encryptor::~CPDF_Encryptor()
423 { 426 {
424 if (m_bNewBuf) { 427 if (m_bNewBuf) {
425 FX_Free(m_pData); 428 FX_Free(m_pData);
426 } 429 }
427 } 430 }
(...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after
2127 m_bNewCrypto = FALSE; 2130 m_bNewCrypto = FALSE;
2128 if (!m_bStandardSecurity) { 2131 if (!m_bStandardSecurity) {
2129 return; 2132 return;
2130 } 2133 }
2131 if (m_pEncryptDict) { 2134 if (m_pEncryptDict) {
2132 m_pEncryptDict->Release(); 2135 m_pEncryptDict->Release();
2133 m_pEncryptDict = NULL; 2136 m_pEncryptDict = NULL;
2134 } 2137 }
2135 m_bStandardSecurity = FALSE; 2138 m_bStandardSecurity = FALSE;
2136 } 2139 }
OLDNEW
« no previous file with comments | « core/include/fxge/fx_ge.h ('k') | core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698