| Index: core/fpdfapi/page/cpdf_image.cpp
|
| diff --git a/core/fpdfapi/page/cpdf_image.cpp b/core/fpdfapi/page/cpdf_image.cpp
|
| index 976d6d8c471bc4bcefc698597b8400c36ac31bfd..0a75e262d2b5fd5fd538486b56c365d7de5d1158 100644
|
| --- a/core/fpdfapi/page/cpdf_image.cpp
|
| +++ b/core/fpdfapi/page/cpdf_image.cpp
|
| @@ -122,8 +122,10 @@ CPDF_Dictionary* CPDF_Image::InitJPEG(uint8_t* pData, uint32_t size) {
|
| m_bIsMask = false;
|
| m_Width = width;
|
| m_Height = height;
|
| - if (!m_pStream)
|
| - m_pStream = new CPDF_Stream;
|
| + if (!m_pStream) {
|
| + m_pOwnedStream = pdfium::MakeUnique<CPDF_Stream>();
|
| + m_pStream = m_pOwnedStream.get();
|
| + }
|
| return pDict;
|
| }
|
|
|
| @@ -334,9 +336,10 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress) {
|
| dest_offset = 0;
|
| }
|
| }
|
| - if (!m_pStream)
|
| - m_pStream = new CPDF_Stream;
|
| -
|
| + if (!m_pStream) {
|
| + m_pOwnedStream = pdfium::MakeUnique<CPDF_Stream>();
|
| + m_pStream = m_pOwnedStream.get();
|
| + }
|
| m_pStream->InitStream(dest_buf, dest_size, pDict);
|
| m_bIsMask = pBitmap->IsAlphaMask();
|
| m_Width = BitmapWidth;
|
|
|