[poppler] Branch 'poppler-0.26' - glib/poppler-input-stream.cc

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Sat Sep 13 06:37:35 PDT 2014


 glib/poppler-input-stream.cc |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit f94ba85a736b4c90c05e7782939f32506472658e
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Fri Sep 12 19:22:20 2014 +0200

    glib: Fix use of uninitialized members in PopplerInputStream
    
    https://bugs.freedesktop.org/show_bug.cgi?id=82630

diff --git a/glib/poppler-input-stream.cc b/glib/poppler-input-stream.cc
index 041cc2e..e57e344 100644
--- a/glib/poppler-input-stream.cc
+++ b/glib/poppler-input-stream.cc
@@ -31,6 +31,8 @@ PopplerInputStream::PopplerInputStream(GInputStream *inputStreamA, GCancellable
   length = lengthA;
   bufPtr = bufEnd = buf;
   bufPos = start;
+  savePos = 0;
+  saved = gFalse;
 }
 
 PopplerInputStream::~PopplerInputStream()
@@ -77,6 +79,7 @@ void PopplerInputStream::setPos(Goffset pos, int dir)
 
   if (dir >= 0) {
     g_seekable_seek(seekable, pos, G_SEEK_SET, cancellable, NULL);
+    bufPos = pos;
   } else {
     g_seekable_seek(seekable, 0, G_SEEK_END, cancellable, NULL);
     size = (Guint)g_seekable_tell(seekable);
@@ -110,7 +113,7 @@ GBool PopplerInputStream::fillBuf()
   if (limited && bufPos + inputStreamBufSize > start + length) {
     n = start + length - bufPos;
   } else {
-    n = inputStreamBufSize;
+    n = inputStreamBufSize - (bufPos % inputStreamBufSize);
   }
 
   n = g_input_stream_read(inputStream, buf, n, cancellable, NULL);


More information about the poppler mailing list