I'm running across a memory error which seems to occasionally bring down my program. I've tracked it down with valgrind:
==20954== Conditional jump or move depends on uninitialised value(s)
==20954==    at 0x4027448: index (mc_replace_strmem.c:160)
==20954==    by 0x51B677F: strstr (in /lib/tls/i686/cmov/libc-2.9.so)
==20954== by 0x41F33CF: PoDoFo::PdfParser::HasLinearizationDict() (PdfParser.cpp:365) ==20954== by 0x41F3B66: PoDoFo::PdfParser::ReadDocumentStructure() (PdfParser.cpp:229) ==20954== by 0x41F486E: PoDoFo::PdfParser::ParseFile(PoDoFo::PdfRefCountedInputDevice const&, bool) (PdfParser.cpp:192) ==20954== by 0x41F4C99: PoDoFo::PdfParser::ParseFile(char const*, bool) (PdfParser.cpp:136) ==20954== by 0x41F5561: PoDoFo::PdfParser::PdfParser(PoDoFo::PdfVecObjects*, char const*, bool) (PdfParser.cpp:62) ==20954== by 0x41C81B2: PoDoFo::PdfMemDocument::Load(char const*) (PdfMemDocument.cpp:144)
==20954==  Uninitialised value was created by a heap allocation
==20954==    at 0x4026FDE: malloc (vg_replace_malloc.c:207)
==20954== by 0x41FAF3D: PoDoFo::PdfRefCountedBuffer::ReallyResize(unsigned int) (PdfRefCountedBuffer.cpp:145) ==20954== by 0x41AFD58: PoDoFo::PdfRefCountedBuffer::Resize(unsigned int) (PdfRefCountedBuffer.h:293) ==20954== by 0x41AFD8C: PoDoFo::PdfRefCountedBuffer::PdfRefCountedBuffer(unsigned int) (PdfRefCountedBuffer.h:213) ==20954== by 0x420F519: PoDoFo::PdfTokenizer::PdfTokenizer() (PdfTokenizer.cpp:132) ==20954== by 0x41F5502: PoDoFo::PdfParser::PdfParser(PoDoFo::PdfVecObjects*, char const*, bool) (PdfParser.cpp:59) ==20954== by 0x41C81B2: PoDoFo::PdfMemDocument::Load(char const*) (PdfMemDocument.cpp:144)
I'm trying to look into it myself, and I will post any findings I have, but perhaps someone else will have better insight. I'm posting the beginning of one of the PDFs in the hopes that someone with a better understanding of what's going on will be able to identify the issue (note that the attached file is in no way a valid PDF, just the first 25 lines of one).

Actually, I think I might have realized something just before I was about to send this along: should that strstr be using the linearizeBuffer instead of m_buffer since linearizeBuffer was just read into?

Thanks,
Mike Slegeir

Attachment: uninited.pdf
Description: Adobe PDF document

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to