diff options
author | Lei Zhang <thestig@chromium.org> | 2017-08-31 12:36:31 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-08-31 20:32:45 +0000 |
commit | 0733a1b6a1c3f1d2907f85e823b1b9674322d97b (patch) | |
tree | e060e9f2d3065819c22e47e904c30d3ef2633431 /fpdfsdk/fpdfeditimg.cpp | |
parent | a864419a26164350a27ff03f34fa30d0166bc077 (diff) | |
download | pdfium-0733a1b6a1c3f1d2907f85e823b1b9674322d97b.tar.xz |
Change FPDFImageObj_GetImageFilter() to return byte strings.
Since the returned data is a key, it should be a byte string and not a
wide string.
Change-Id: I9243d88586ea5b13c4b6556479d17316bf07e32e
Reviewed-on: https://pdfium-review.googlesource.com/12710
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfeditimg.cpp')
-rw-r--r-- | fpdfsdk/fpdfeditimg.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fpdfsdk/fpdfeditimg.cpp b/fpdfsdk/fpdfeditimg.cpp index 662ad23d76..5e3191635e 100644 --- a/fpdfsdk/fpdfeditimg.cpp +++ b/fpdfsdk/fpdfeditimg.cpp @@ -244,13 +244,16 @@ FPDFImageObj_GetImageFilter(FPDF_PAGEOBJECT image_object, CPDF_PageObject* pObj = CPDFPageObjectFromFPDFPageObject(image_object); CPDF_Object* pFilter = pObj->AsImage()->GetImage()->GetDict()->GetDirectObjectFor("Filter"); - CFX_WideString wsFilters; + CFX_ByteString bsFilter; if (pFilter->IsName()) - wsFilters = pFilter->AsName()->GetUnicodeText(); + bsFilter = pFilter->AsName()->GetString(); else - wsFilters = pFilter->AsArray()->GetUnicodeTextAt(index); + bsFilter = pFilter->AsArray()->GetStringAt(index); - return Utf16EncodeMaybeCopyAndReturnLength(wsFilters, buffer, buflen); + unsigned long len = bsFilter.GetLength() + 1; + if (buffer && len <= buflen) + memcpy(buffer, bsFilter.c_str(), len); + return len; } FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV |