diff options
author | Lei Zhang <thestig@chromium.org> | 2017-09-13 13:22:54 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-14 05:42:50 +0000 |
commit | 038740c2fbd27f5a6a0fad8903546ecb69a2f9a4 (patch) | |
tree | 573da77f74b4277fec9be73f64354d5ea72b3bd4 /fpdfsdk/fpdfview.cpp | |
parent | 24b0733a72bbc4013bff8628f198b0aea807aa06 (diff) | |
download | pdfium-038740c2fbd27f5a6a0fad8903546ecb69a2f9a4.tar.xz |
Fix CPDFPathObjectFromFPDFPageObject() implementation.
It should make sure the FPDF_PAGEOJECT passed in is actually a path.
Change-Id: I89d0626dc350fd2f65b08282b276a4de2c3a7398
Reviewed-on: https://pdfium-review.googlesource.com/13710
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfview.cpp')
-rw-r--r-- | fpdfsdk/fpdfview.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp index 5bcc643ac1..0aaafe8afb 100644 --- a/fpdfsdk/fpdfview.cpp +++ b/fpdfsdk/fpdfview.cpp @@ -336,7 +336,8 @@ CPDF_Page* CPDFPageFromFPDFPage(FPDF_PAGE page) { } CPDF_PathObject* CPDFPathObjectFromFPDFPageObject(FPDF_PAGEOBJECT page_object) { - return static_cast<CPDF_PathObject*>(page_object); + auto* obj = CPDFPageObjectFromFPDFPageObject(page_object); + return obj ? obj->AsPath() : nullptr; } CPDF_PageObject* CPDFPageObjectFromFPDFPageObject(FPDF_PAGEOBJECT page_object) { |