summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-09-19 18:55:24 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-09-19 18:55:24 +0000
commitd39389f6ec2eb96695d2645e1fc4e71fd7c5da08 (patch)
treecbb8b5619501fd4fd9c17d63ff7d3fdafeb9f519 /fpdfsdk
parent3df24e9fb7cd66dadda76c617d18a779f0bf535a (diff)
downloadpdfium-d39389f6ec2eb96695d2645e1fc4e71fd7c5da08.tar.xz
Use MaybeOwned in CPDF_StreamAcc.chromium/3557
Change-Id: Iba886e51cf34ea01ed0d93afc93c8ec0ffed4f52 Reviewed-on: https://pdfium-review.googlesource.com/42594 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdf_flatten.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/fpdfsdk/fpdf_flatten.cpp b/fpdfsdk/fpdf_flatten.cpp
index 7ea49cfddf..cca28bc300 100644
--- a/fpdfsdk/fpdf_flatten.cpp
+++ b/fpdfsdk/fpdf_flatten.cpp
@@ -386,9 +386,12 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
ByteString sFormName = ByteString::Format("F%d", i);
pXObject->SetFor(sFormName, pObj->MakeReference(pDocument));
- auto pAcc = pdfium::MakeRetain<CPDF_StreamAcc>(pNewXObject);
- pAcc->LoadAllDataFiltered();
- ByteString sStream(pAcc->GetData(), pAcc->GetSize());
+ ByteString sStream;
+ {
+ auto pAcc = pdfium::MakeRetain<CPDF_StreamAcc>(pNewXObject);
+ pAcc->LoadAllDataFiltered();
+ sStream = ByteString(pAcc->GetSpan());
+ }
CFX_Matrix matrix = pAPDic->GetMatrixFor("Matrix");
CFX_Matrix m = GetMatrix(rcAnnot, rcStream, matrix);
sStream += ByteString::Format("q %f 0 0 %f %f %f cm /%s Do Q\n", m.a, m.d,