Discussion:
[gs-bugs] [Bug 698719] - MuPDF - fz_open_document const char* bug convert
b***@artifex.com
2017-11-02 13:30:37 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698719

Bug ID: 698719
Summary: fz_open_document const char* bug convert
Product: MuPDF
Version: 1.11
Hardware: PC
OS: Windows 7
Status: UNCONFIRMED
Severity: blocker
Priority: P4
Component: mupdf
Assignee: mupdf-***@artifex.com
Reporter: ***@yahoo.com.br
QA Contact: gs-***@ghostscript.com
Word Size: ---

// if I get a Cstring and then pass to std::string
// and then if I put the std::string.c_str() in the <filepath> the
//fz_open_document.

//std::string filepath(CW2A(l_SampleDlg.GetPathName()));
fz_document *_doc = fz_open_document(_ctx, filepath); /*== NULL*/

// simply dont open and return null
// ---- it necessary convert the cstring to const char*
//like this
/*
CString TempCs_Cs = l_SampleDlg.GetPathName();
const char* filepath;
CT2A ascii(TempCs_Cs, CP_UTF8);
TRACE(_T("UTF8: %S\n"), ascii.m_psz);
filepath = ascii;

fz_document *_doc = fz_open_document(_ctx, filepath); /* == Return success*/
*/

is that really supposed to happened?
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-11-02 13:34:21 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698719

Ericson <***@yahoo.com.br> changed:

What |Removed |Added
----------------------------------------------------------------------------
Severity|blocker |critical

--- Comment #1 from Ericson <***@yahoo.com.br> ---
i dont not know is this supposed to happened or if I miss something on the
document , but maybe this type of convertion is corrupting the const string for
some reason.
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@artifex.com
2017-11-02 13:36:47 UTC
Permalink
http://bugs.ghostscript.com/show_bug.cgi?id=698719

Ken Sharp <***@artifex.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Severity|critical |normal
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID

--- Comment #2 from Ken Sharp <***@artifex.com> ---
MuPDF is written in C, not C++ it looks to me like you are passing a C++ string
object to a function which expects a C string.

That's not going to work.

If you want to use MuPDF with C++ you are going to have to write some kind of
interface, or at least not try and pass C++ objects to the C interface.
--
You are receiving this mail because:
You are the QA Contact for the bug.
Loading...