summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfview.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-06-19 14:51:10 -0700
committerLei Zhang <thestig@chromium.org>2015-06-19 14:51:10 -0700
commitcfac954abcab7caf47d3fa3d641c553cba998271 (patch)
tree4cd546a2377e973fec54b75c1002c8c0ff321e8f /fpdfsdk/src/fpdfview.cpp
parentdf558514bf5cb5750d5a7000a843f45f4170d5a4 (diff)
downloadpdfium-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.cpp17
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,