pdf-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pdf-devel] Bug in pdf_stm_flush()


From: jemarch
Subject: Re: [pdf-devel] Bug in pdf_stm_flush()
Date: Fri, 06 Feb 2009 01:35:38 +0100
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

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  <address@hidden>
                  http://www.jemarch.net
GNU Project       http://www.gnu.org






reply via email to

[Prev in Thread] Current Thread [Next in Thread]