Hi,

I'm using PoDoFo (svn version) to extract page thumbnails from pdfs
and run into ePdfError_ValueOutOfRange exception in

  podofo.dll!PoDoFo::PdfLZWFilter::DecodeBlockImpl(const char *
pBuffer=0x0029f58b, int lLen=1)  Line 710       C++
  podofo.dll!PoDoFo::PdfFilter::DecodeBlock(const char *
pBuffer=0x0029f588, int lLen=4)  Line 374 + 0x17 bytes  C++
  podofo.dll!PoDoFo::PdfFilteredDecodeStream::Write(const char *
pBuffer=0x0029f588, int lLen=4)  Line 162       C++
  podofo.dll!PoDoFo::PdfAscii85Filter::WidePut(unsigned long
tuple=3772987464, int bytes=4)  Line 414 + 0x22 bytes   C++
  podofo.dll!PoDoFo::PdfAscii85Filter::DecodeBlockImpl(const char *
pBuffer=0x024b37ed, int lLen=452)  Line 347     C++
  podofo.dll!PoDoFo::PdfFilter::DecodeBlock(const char *
pBuffer=0x024b37d0, int lLen=481)  Line 374 + 0x17 bytes        C++
  podofo.dll!PoDoFo::PdfFilteredDecodeStream::Write(const char *
pBuffer=0x024b37d0, int lLen=481)  Line 162     C++
  podofo.dll!PoDoFo::PdfStream::GetFilteredCopy(PoDoFo::PdfOutputStream
* pStream=0x0029f8a8)  Line 56 + 0x3d bytes     C++
  thumb.exe!main(int argc=1, char * * argv=0x00fb57e0)  Line 29 C++

the code is quite simple
<code>
    using namespace PoDoFo;

    PdfMemDocument doc;
    doc.Load( file_path );

    PdfPage* page = doc.GetPage( 0 );
    PdfObject* page_obj = page->GetObject();
    PdfObject* thumb_obj = page_obj->GetIndirectKey( "Thumb" ); // 252 0 obj
    PdfObject* cs_obj = thumb_obj->GetIndirectKey( "ColorSpace" ); // 258 0 obj
    PdfArray cs_arr = cs_obj->GetArray();
    PdfObject stream_ref_obj = cs_arr[3]; // 257 0 R
    PdfVecObjects* owner = cs_obj->GetOwner();
    PdfObject* stream_obj = owner->GetObject(
stream_ref_obj.GetReference() ); // 257 0 obj

    PdfRefCountedBuffer buffer;
    PdfBufferOutputStream stream( &buffer );
    PdfStream* pdf_stream = stream_obj->GetStream(); // << /Filter [
/ASCII85Decode /LZWDecode ] /Length 256 0 R >>
    pdf_stream->GetFilteredCopy( &stream ); // failed here

</code>

It looks like the bug for me somewhere on the filters boundary or in
LZW decoding but I'm not sure. Could somebody clarify that this is the
bug?


-- 
Best regards,
Aleksey Chernoraenko

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to