summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_flatten_embeddertest.cpp
AgeCommit message (Collapse)Author
2018-10-18Push/pop the graphics state stack when flattening.Lei Zhang
When FPDFPage_Flatten() manipulates a content stream, it replaces the content stream with a content stream array. The first element in the array is the original content stream and the second element in the array is the flattened annotations content. To make sure the original content stream's graphics state stack does not affect the flattened annotations, FPDFPage_Flatten() rewrites the original content stream to be: q $contents Q When FPDFPage_Flatten() manipulates a content stream array, it just appends the flattened annotations as a new element in the array. This may result in graphics state stack leaking out. To fix this, wrap the content stream array to be: ["q", $content1, ..., $contentN, "Q"] And then append the flattened annotations. BUG=chromium:896366 Change-Id: Ic6499e39eb4c9f1fe45d037622bf02be724b6cae Reviewed-on: https://pdfium-review.googlesource.com/c/44252 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2018-10-02Normalize widget bounding boxes when flattening.Lei Zhang
BUG=chromium:890322 Change-Id: I11050b84cf440f8d6bb00c661360de4e389dc031 Reviewed-on: https://pdfium-review.googlesource.com/c/43290 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-08-31Remove fx_basic.hDan Sinclair
This CL removes the fx_basic.h header and fixes up includes as needed. Change-Id: I49af32a8327bdbcda40c50a61ffbd75d06609040 Reviewed-on: https://pdfium-review.googlesource.com/12670 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2016-11-08Fix abort above FPDFPage_Flattentsepez
Main issue: FPDFPage_Flatten trying to re-add an indirect object. BUG=662698 Review-Url: https://codereview.chromium.org/2489653003