diff options
author | tsepez <tsepez@chromium.org> | 2016-12-14 19:48:47 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-12-14 19:48:47 -0800 |
commit | b8642f8a3c3a6d359c4e319b8ba91f8df6448a4f (patch) | |
tree | bc5443fec6a3bf35dd883a66cdfd056397998013 /core/fxge/dib/fx_dib_main.cpp | |
parent | c7739322e5cdcc5779bdde2a1560ea3dee891e51 (diff) | |
download | pdfium-b8642f8a3c3a6d359c4e319b8ba91f8df6448a4f.tar.xz |
More unique_ptr returns from DIB methods.
Review-Url: https://codereview.chromium.org/2572293002
Diffstat (limited to 'core/fxge/dib/fx_dib_main.cpp')
-rw-r--r-- | core/fxge/dib/fx_dib_main.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/fxge/dib/fx_dib_main.cpp b/core/fxge/dib/fx_dib_main.cpp index f90cbc1a91..8e6366d5c0 100644 --- a/core/fxge/dib/fx_dib_main.cpp +++ b/core/fxge/dib/fx_dib_main.cpp @@ -1342,12 +1342,12 @@ bool CFX_DIBitmap::ConvertColorScale(uint32_t forecolor, uint32_t backcolor) { return true; } -CFX_DIBitmap* CFX_DIBSource::FlipImage(bool bXFlip, bool bYFlip) const { - CFX_DIBitmap* pFlipped = new CFX_DIBitmap; - if (!pFlipped->Create(m_Width, m_Height, GetFormat())) { - delete pFlipped; +std::unique_ptr<CFX_DIBitmap> CFX_DIBSource::FlipImage(bool bXFlip, + bool bYFlip) const { + auto pFlipped = pdfium::MakeUnique<CFX_DIBitmap>(); + if (!pFlipped->Create(m_Width, m_Height, GetFormat())) return nullptr; - } + pFlipped->SetPalette(m_pPalette.get()); uint8_t* pDestBuffer = pFlipped->GetBuffer(); int Bpp = m_bpp / 8; |