Created attachment 137181 [details] [review] Add type annotation to poppler_document_new_from_data() In Poppler-0.18.gir poppler_document_new_from_data() is defined as following: <constructor name="new_from_data" c:identifier="poppler_document_new_from_data" throws="1"> <doc xml:space="preserve">Creates a new #PopplerDocument. If %NULL is returned, then @error will be set. Possible errors include those in the #POPPLER_ERROR and #G_FILE_ERROR domains.</doc> <return-value transfer-ownership="full"> <doc xml:space="preserve">A newly created #PopplerDocument, or %NULL</doc> <type name="Document" c:type="PopplerDocument*"/> </return-value> <parameters> <parameter name="data" transfer-ownership="none"> <doc xml:space="preserve">the pdf data contained in a char array</doc> <type name="utf8" c:type="char*"/> </parameter> <parameter name="length" transfer-ownership="none"> <doc xml:space="preserve">the length of #data</doc> <type name="gint" c:type="int"/> </parameter> <parameter name="password" transfer-ownership="none" nullable="1" allow-none="1"> <doc xml:space="preserve">password to unlock the file with, or %NULL</doc> <type name="utf8" c:type="const char*"/> </parameter> </parameters> </constructor> This definition validates data as UTF-8 string when read a PDF data using poppler_document_new_from_data() via gobject-introspection. In general, PDF data is not UTF-8 string. So we should treat parameter data as binary. I wrote tiny patch and confirm that the poppler_document_new_from_data() definition is updated after applied this patch. However, I'm not familiar with gobject-introspection in honest.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/poppler/poppler/issues/448.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.