summaryrefslogtreecommitdiff
path: root/core/fxge/win32
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-10-15 16:56:47 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-15 16:56:47 +0000
commit7c39bf7b87f871ccc50b66066c3bfb1883f66010 (patch)
tree57f56441c6e7b136ee0418fcb2dc53d866a780c0 /core/fxge/win32
parent4f5ccaaecd7e524e98b79af6823a9ab6a8753d7f (diff)
downloadpdfium-7c39bf7b87f871ccc50b66066c3bfb1883f66010.tar.xz
Make FlateEncode()'s buffer out parameter a unique_ptr.
Change-Id: I31a5abb3c8dd31826098493f51effbd5afe109d1 Reviewed-on: https://pdfium-review.googlesource.com/c/41856 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxge/win32')
-rw-r--r--core/fxge/win32/cfx_psrenderer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/fxge/win32/cfx_psrenderer.cpp b/core/fxge/win32/cfx_psrenderer.cpp
index 12795d0cc5..e66e9685ff 100644
--- a/core/fxge/win32/cfx_psrenderer.cpp
+++ b/core/fxge/win32/cfx_psrenderer.cpp
@@ -59,8 +59,10 @@ void PSCompressData(int PSLevel,
uint8_t* dest_buf = nullptr;
uint32_t dest_size = src_size;
if (PSLevel >= 3) {
- if (pEncoders->GetFlateModule()->Encode(src_buf, src_size, &dest_buf,
+ std::unique_ptr<uint8_t, FxFreeDeleter> dest_buf_unique;
+ if (pEncoders->GetFlateModule()->Encode(src_buf, src_size, &dest_buf_unique,
&dest_size)) {
+ dest_buf = dest_buf_unique.release();
*filter = "/FlateDecode filter ";
}
} else {