From bb1ee53577418429d2e30180bd941f16eea8b340 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 30 Jan 2018 18:10:01 +0000 Subject: Revert "Revert "Use UnownedPtr instead of T* in MaybeOwned."" This reverts commit 77d8ed02c7e97471ceccee5abbabeb2fdea413c7. Reason for revert: Original change's description: > Revert "Use UnownedPtr instead of T* in MaybeOwned." > > This reverts commit e563e8352139e4852a955e319023b09f2844aee9. > > Reason for revert: > > Original change's description: > > Use UnownedPtr instead of T* in MaybeOwned. > > > > Always check the liftime in the unowned case. Doing so unearthed > > the following issues: > > > > Transient lifetime issue in jbig2_image when doing realloc(). > > Stale (but unused) dictionary pointer in CPDF_Image. > > Destruction order in error branch in cpdf_dibsource.cpp > > > > Change-Id: I12b758aafeefedc7abe1e8b21a18db959929e95f > > Reviewed-on: https://pdfium-review.googlesource.com/24552 > > Commit-Queue: Tom Sepez > > Reviewed-by: dsinclair > > TBR=thestig@chromium.org,tsepez@chromium.org,dsinclair@chromium.org > > Change-Id: I3c56ee6ab502da90e3adb7507dbc8cc92f090140 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://pdfium-review.googlesource.com/24670 > Reviewed-by: Tom Sepez > Commit-Queue: Tom Sepez TBR=thestig@chromium.org,tsepez@chromium.org,dsinclair@chromium.org Change-Id: I0ccbbeab8be6cadc9b3a5bfefe2aca733654342f No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://pdfium-review.googlesource.com/24671 Reviewed-by: Tom Sepez Commit-Queue: Tom Sepez --- core/fpdfapi/render/cpdf_dibsource.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/fpdfapi/render') diff --git a/core/fpdfapi/render/cpdf_dibsource.cpp b/core/fpdfapi/render/cpdf_dibsource.cpp index aff63d102d..48715d2ecb 100644 --- a/core/fpdfapi/render/cpdf_dibsource.cpp +++ b/core/fpdfapi/render/cpdf_dibsource.cpp @@ -341,9 +341,9 @@ int CPDF_DIBSource::ContinueLoadDIBSource(IFX_PauseIndicator* pPause) { } if (iDecodeStatus < 0) { + m_pJbig2Context.reset(); m_pCachedBitmap.Reset(); m_pGlobalStream.Reset(); - m_pJbig2Context.reset(); return 0; } if (iDecodeStatus == FXCODEC_STATUS_DECODE_TOBECONTINUE) -- cgit v1.2.3