diff options
author | Lei Zhang <thestig@chromium.org> | 2015-06-19 14:51:10 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-06-19 14:51:10 -0700 |
commit | cfac954abcab7caf47d3fa3d641c553cba998271 (patch) | |
tree | 4cd546a2377e973fec54b75c1002c8c0ff321e8f /fpdfsdk/src/fpdfview.cpp | |
parent | df558514bf5cb5750d5a7000a843f45f4170d5a4 (diff) | |
download | pdfium-cfac954abcab7caf47d3fa3d641c553cba998271.tar.xz |
Cleanup: Do not check pointers before deleting them.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1192743004.
Diffstat (limited to 'fpdfsdk/src/fpdfview.cpp')
-rw-r--r-- | fpdfsdk/src/fpdfview.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp index 54731193dd..9db0554ab3 100644 --- a/fpdfsdk/src/fpdfview.cpp +++ b/fpdfsdk/src/fpdfview.cpp @@ -481,14 +481,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 @@ -662,8 +660,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, |