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

Side by Side Diff: xfa/fxfa/app/xfa_ffwidget.cpp

Issue 1925363002: Do not check pointers before deleting them. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 4 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 | « xfa/fxfa/app/xfa_ffpushbutton.cpp ('k') | xfa/fxfa/app/xfa_textlayout.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 "xfa/fxfa/include/xfa_ffwidget.h" 7 #include "xfa/fxfa/include/xfa_ffwidget.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 m_pCloneConvert = NULL; 519 m_pCloneConvert = NULL;
520 m_BitmapAlpha = 255; 520 m_BitmapAlpha = 255;
521 m_FillArgb = 0; 521 m_FillArgb = 0;
522 m_Flags = 0; 522 m_Flags = 0;
523 m_pTransformer = NULL; 523 m_pTransformer = NULL;
524 m_DeviceHandle = NULL; 524 m_DeviceHandle = NULL;
525 m_BlendType = FXDIB_BLEND_NORMAL; 525 m_BlendType = FXDIB_BLEND_NORMAL;
526 m_Result = TRUE; 526 m_Result = TRUE;
527 m_bPrint = FALSE; 527 m_bPrint = FALSE;
528 } 528 }
529
529 CXFA_ImageRenderer::~CXFA_ImageRenderer() { 530 CXFA_ImageRenderer::~CXFA_ImageRenderer() {
530 if (m_pCloneConvert) { 531 delete m_pCloneConvert;
531 delete m_pCloneConvert; 532 delete m_pTransformer;
532 } 533 if (m_DeviceHandle)
533 if (m_pTransformer) {
534 delete m_pTransformer;
535 }
536 if (m_DeviceHandle) {
537 m_pDevice->CancelDIBits(m_DeviceHandle); 534 m_pDevice->CancelDIBits(m_DeviceHandle);
538 }
539 } 535 }
536
540 FX_BOOL CXFA_ImageRenderer::Start(CFX_RenderDevice* pDevice, 537 FX_BOOL CXFA_ImageRenderer::Start(CFX_RenderDevice* pDevice,
541 CFX_DIBSource* pDIBSource, 538 CFX_DIBSource* pDIBSource,
542 FX_ARGB bitmap_argb, 539 FX_ARGB bitmap_argb,
543 int bitmap_alpha, 540 int bitmap_alpha,
544 const CFX_Matrix* pImage2Device, 541 const CFX_Matrix* pImage2Device,
545 uint32_t flags, 542 uint32_t flags,
546 int blendType) { 543 int blendType) {
547 m_pDevice = pDevice; 544 m_pDevice = pDevice;
548 m_pDIBSource = pDIBSource; 545 m_pDIBSource = pDIBSource;
549 m_FillArgb = bitmap_argb; 546 m_FillArgb = bitmap_argb;
(...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after
1958 iType != XFA_ELEMENT_Rectangle) { 1955 iType != XFA_ELEMENT_Rectangle) {
1959 return; 1956 return;
1960 } 1957 }
1961 CXFA_StrokeArray strokes; 1958 CXFA_StrokeArray strokes;
1962 if (!(dwFlags & XFA_DRAWBOX_ForceRound) && iType != XFA_ELEMENT_Arc) { 1959 if (!(dwFlags & XFA_DRAWBOX_ForceRound) && iType != XFA_ELEMENT_Arc) {
1963 box.GetStrokes(strokes); 1960 box.GetStrokes(strokes);
1964 } 1961 }
1965 XFA_BOX_Fill(box, strokes, pGS, rtWidget, pMatrix, dwFlags); 1962 XFA_BOX_Fill(box, strokes, pGS, rtWidget, pMatrix, dwFlags);
1966 XFA_BOX_Stroke(box, strokes, pGS, rtWidget, pMatrix, dwFlags); 1963 XFA_BOX_Stroke(box, strokes, pGS, rtWidget, pMatrix, dwFlags);
1967 } 1964 }
OLDNEW
« no previous file with comments | « xfa/fxfa/app/xfa_ffpushbutton.cpp ('k') | xfa/fxfa/app/xfa_textlayout.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698