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

Unified Diff: core/src/fpdfdoc/doc_annot.cpp

Issue 1142713005: Remove FX_Alloc() null checks now that it can't return NULL. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Fix missing FX_Alloc2D, check overflow on add, remove unused enum. 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/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp ('k') | core/src/fpdftext/fpdf_text.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfdoc/doc_annot.cpp
diff --git a/core/src/fpdfdoc/doc_annot.cpp b/core/src/fpdfdoc/doc_annot.cpp
index 4ccce21f1c5b649d46462906f04e24eec1938965..0ddcb2305ed2103ac4a97ba0a4c44ff3ea4203e7 100644
--- a/core/src/fpdfdoc/doc_annot.cpp
+++ b/core/src/fpdfdoc/doc_annot.cpp
@@ -339,9 +339,6 @@ CPDF_PageObject* CPDF_Annot::GetBorder(FX_BOOL bPrint, const CPDF_RenderOptions*
dash_count ++;
}
pGraphState->m_DashArray = FX_Alloc(FX_FLOAT, dash_count);
- if (pGraphState->m_DashArray == NULL) {
- return NULL;
- }
pGraphState->m_DashCount = dash_count;
FX_DWORD i;
for (i = 0; i < pDashArray->GetCount(); i ++) {
@@ -352,9 +349,6 @@ CPDF_PageObject* CPDF_Annot::GetBorder(FX_BOOL bPrint, const CPDF_RenderOptions*
}
} else {
pGraphState->m_DashArray = FX_Alloc(FX_FLOAT, 2);
- if (pGraphState->m_DashArray == NULL) {
- return NULL;
- }
pGraphState->m_DashCount = 2;
pGraphState->m_DashArray[0] = pGraphState->m_DashArray[1] = 3 * 1.0f;
}
@@ -441,9 +435,6 @@ void CPDF_Annot::DrawBorder(CFX_RenderDevice* pDevice, const CFX_AffineMatrix* p
dash_count ++;
}
graph_state.m_DashArray = FX_Alloc(FX_FLOAT, dash_count);
- if (graph_state.m_DashArray == NULL) {
- return ;
- }
graph_state.m_DashCount = dash_count;
FX_DWORD i;
for (i = 0; i < pDashArray->GetCount(); i ++) {
@@ -454,9 +445,6 @@ void CPDF_Annot::DrawBorder(CFX_RenderDevice* pDevice, const CFX_AffineMatrix* p
}
} else {
graph_state.m_DashArray = FX_Alloc(FX_FLOAT, 2);
- if (graph_state.m_DashArray == NULL) {
- return ;
- }
graph_state.m_DashCount = 2;
graph_state.m_DashArray[0] = graph_state.m_DashArray[1] = 3 * 1.0f;
}
« no previous file with comments | « core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp ('k') | core/src/fpdftext/fpdf_text.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698