diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-08-28 16:59:30 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-08-28 16:59:30 +0000 |
commit | 7e4fff7163382cb40b761a383fad9a2e313713c7 (patch) | |
tree | 8cc956993f28a7fe280f795cfdd7170ead37615d /core/fxcodec/codec/ccodec_progressivedecoder.h | |
parent | f2615a38d963c35c4e11def602ab2cbea266b708 (diff) | |
download | pdfium-7e4fff7163382cb40b761a383fad9a2e313713c7.tar.xz |
Let CCodec_ProgressiveDecoder::m_pSrcBuf outlive contexts
This requires making some members unique_ptr<> to preserve the
destruction order.
Bug: 877766
Change-Id: I69e0173fdde7e9cd0d24017d6c829b9b9cf600c0
Reviewed-on: https://pdfium-review.googlesource.com/41490
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxcodec/codec/ccodec_progressivedecoder.h')
-rw-r--r-- | core/fxcodec/codec/ccodec_progressivedecoder.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/fxcodec/codec/ccodec_progressivedecoder.h b/core/fxcodec/codec/ccodec_progressivedecoder.h index b5890e9d9c..4216a84a51 100644 --- a/core/fxcodec/codec/ccodec_progressivedecoder.h +++ b/core/fxcodec/codec/ccodec_progressivedecoder.h @@ -246,6 +246,10 @@ class CCodec_ProgressiveDecoder : RetainPtr<IFX_SeekableReadStream> m_pFile; RetainPtr<CFX_DIBitmap> m_pDeviceBitmap; UnownedPtr<CCodec_ModuleMgr> m_pCodecMgr; + // |m_pSrcBuf| must outlive |m_pGifContext|. + std::unique_ptr<uint8_t, FxFreeDeleter> m_pSrcBuf; + std::unique_ptr<uint8_t, FxFreeDeleter> m_pDecodeBuf; + std::unique_ptr<FX_ARGB, FxFreeDeleter> m_pSrcPalette; std::unique_ptr<CCodec_JpegModule::Context> m_pJpegContext; #ifdef PDF_ENABLE_XFA_BMP std::unique_ptr<CCodec_BmpModule::Context> m_pBmpContext; @@ -260,9 +264,7 @@ class CCodec_ProgressiveDecoder : std::unique_ptr<CCodec_TiffModule::Context> m_pTiffContext; #endif // PDF_ENABLE_XFA_TIFF uint32_t m_offSet = 0; - uint8_t* m_pSrcBuf = nullptr; uint32_t m_SrcSize = 0; - uint8_t* m_pDecodeBuf = nullptr; int m_ScanlineSize = 0; CFXCODEC_WeightTable m_WeightHorz; CFXCODEC_VertTable m_WeightVert; @@ -277,7 +279,6 @@ class CCodec_ProgressiveDecoder : int m_sizeX = 0; int m_sizeY = 0; int m_TransMethod = -1; - FX_ARGB* m_pSrcPalette = nullptr; int m_SrcPaletteNumber = 0; int m_SrcRow = 0; FXCodec_Format m_SrcFormat = FXCodec_Invalid; |