summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfview.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-06-19 17:26:17 -0700
committerLei Zhang <thestig@chromium.org>2015-06-19 17:26:17 -0700
commit6d8b1c2c7b1cbada20109f70ae971a4192330bb5 (patch)
treee755b7cb2624622cba606134493d25fb7f1ce6c8 /fpdfsdk/src/fpdfview.cpp
parent9883a7da2d4f31910073c03e703d5b97a45d9254 (diff)
downloadpdfium-6d8b1c2c7b1cbada20109f70ae971a4192330bb5.tar.xz
Merge to XFA: Cleanup: Do not check pointers before deleting them.
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1192743004. (cherry picked from commit cfac954abcab7caf47d3fa3d641c553cba998271) Review URL: https://codereview.chromium.org/1196783003.
Diffstat (limited to 'fpdfsdk/src/fpdfview.cpp')
-rw-r--r--fpdfsdk/src/fpdfview.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index 4e6ffb0000..80a9fa52a3 100644
--- a/fpdfsdk/src/fpdfview.cpp
+++ b/fpdfsdk/src/fpdfview.cpp
@@ -607,14 +607,12 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int
#endif
#endif
- if (bBackgroundAlphaNeeded)
- {
- if (pBitmap)
- delete pBitmap;
- pBitmap = NULL;
- }
- delete pContext;
- pPage->RemovePrivateData((void*)1);
+ if (bBackgroundAlphaNeeded) {
+ delete pBitmap;
+ pBitmap = NULL;
+ }
+ delete pContext;
+ pPage->RemovePrivateData((void*)1);
}
#endif
@@ -769,8 +767,7 @@ DLLEXPORT int STDCALL FPDFBitmap_GetStride(FPDF_BITMAP bitmap)
DLLEXPORT void STDCALL FPDFBitmap_Destroy(FPDF_BITMAP bitmap)
{
- if (bitmap == NULL) return;
- delete (CFX_DIBitmap*)bitmap;
+ delete (CFX_DIBitmap*)bitmap;
}
void FPDF_RenderPage_Retail(CRenderContext* pContext, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,