summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfeditimg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdfeditimg.cpp')
-rw-r--r--fpdfsdk/fpdfeditimg.cpp11
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