diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-10-10 17:53:50 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-10 17:53:50 +0000 |
commit | 8d8d3bc54593d2d86054d59669b86a959ec0b602 (patch) | |
tree | 0d36d5bd9594d8cf85fb45e25dce9f189be91a0e /core/fxcodec/codec/ccodec_progressivedecoder.h | |
parent | 65b8db9a76b4b303d97836037b24b19e797fcd86 (diff) | |
download | pdfium-8d8d3bc54593d2d86054d59669b86a959ec0b602.tar.xz |
Fix dangling reference in CFX_CodecMemory.
Do this by making CFX_CodecMemory actually own the memory that
it is ref-counting. Remove some test cases that are now prohibited,
and relax one lifetime restriction in the test because we are now
doing one additional copy (in the test, but not in real life).
Bug:879512
Change-Id: If030dfcf97fe40155c46a42288fc73192437ce9c
Reviewed-on: https://pdfium-review.googlesource.com/c/43670
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 | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/core/fxcodec/codec/ccodec_progressivedecoder.h b/core/fxcodec/codec/ccodec_progressivedecoder.h index 9821c67f4f..d0419f8268 100644 --- a/core/fxcodec/codec/ccodec_progressivedecoder.h +++ b/core/fxcodec/codec/ccodec_progressivedecoder.h @@ -251,8 +251,7 @@ 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; + RetainPtr<CFX_CodecMemory> m_pCodecMemory; std::unique_ptr<uint8_t, FxFreeDeleter> m_pDecodeBuf; std::unique_ptr<FX_ARGB, FxFreeDeleter> m_pSrcPalette; std::unique_ptr<CodecModuleIface::Context> m_pJpegContext; |