Hi Lukasz.

   There is a bug in function pdf_stm_flush() in file pdf-stm.c at line 327.
   It is produced when beckend is full or not all cache is written to beckend.
   327:      cache_size = stm->cache->wp - stm->cache->rp;
   328:      written_bytes = pdf_stm_be_write (stm->backend,
                                          stm->cache->data + stm->cache->rp,
                                          cache_size);

   332:      /* Rewind the cache */
              pdf_buffer_rewind (stm->cache);

   In line 332 stream cache is erased, so cache_size-written_bytes is lost.

I just committed a patch that should fix this bug: if the backend
reports and EOF condition then PDF_EEOF is returned to the caller. It
is possible to call pdf_stm_flush again after making some room in the
backend.

--
Jose E. Marchesi  <[email protected]>
                  http://www.jemarch.net
GNU Project       http://www.gnu.org




Reply via email to