summaryrefslogtreecommitdiff
path: root/core/fxcodec
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-01-30 18:10:01 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-30 18:10:01 +0000
commitbb1ee53577418429d2e30180bd941f16eea8b340 (patch)
treea323757e674ebab8ee7da05c169435e1062d1c26 /core/fxcodec
parent77d8ed02c7e97471ceccee5abbabeb2fdea413c7 (diff)
downloadpdfium-bb1ee53577418429d2e30180bd941f16eea8b340.tar.xz
Revert "Revert "Use UnownedPtr instead of T* in MaybeOwned.""
This reverts commit 77d8ed02c7e97471ceccee5abbabeb2fdea413c7. Reason for revert: <INSERT REASONING HERE> Original change's description: > Revert "Use UnownedPtr instead of T* in MaybeOwned." > > This reverts commit e563e8352139e4852a955e319023b09f2844aee9. > > Reason for revert: <INSERT REASONING HERE> > > 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 <tsepez@chromium.org> > > Reviewed-by: dsinclair <dsinclair@chromium.org> > > 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 <tsepez@chromium.org> > Commit-Queue: Tom Sepez <tsepez@chromium.org> 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 <tsepez@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxcodec')
-rw-r--r--core/fxcodec/jbig2/JBig2_Image.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/fxcodec/jbig2/JBig2_Image.cpp b/core/fxcodec/jbig2/JBig2_Image.cpp
index b0d75d4d96..d229e0ca01 100644
--- a/core/fxcodec/jbig2/JBig2_Image.cpp
+++ b/core/fxcodec/jbig2/JBig2_Image.cpp
@@ -234,8 +234,8 @@ void CJBig2_Image::expand(int32_t h, bool v) {
return;
if (m_pData.IsOwned()) {
- m_pData.Reset(std::unique_ptr<uint8_t, FxFreeDeleter>(
- FX_Realloc(uint8_t, m_pData.Release().release(), h * m_nStride)));
+ m_pData.Reset(std::unique_ptr<uint8_t, FxFreeDeleter>(FX_Realloc(
+ uint8_t, m_pData.ReleaseAndClear().release(), h * m_nStride)));
} else {
uint8_t* pExternalBuffer = data();
m_pData.Reset(std::unique_ptr<uint8_t, FxFreeDeleter>(