summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2014-09-12 17:22:20 (GMT)
committerCarlos Garcia Campos <carlosgc@gnome.org>2014-09-13 13:36:34 (GMT)
commit4589ce17caf94e7c5fa856906d3a8cc08e999d73 (patch)
tree8899a8aa0204cc9c8ccec3998f6700e88b46e533
parentfe67324d450c356b7c876cf50da705156112513a (diff)
glib: Fix use of uninitialized members in PopplerInputStreamHEADmaster
https://bugs.freedesktop.org/show_bug.cgi?id=82630
-rw-r--r--glib/poppler-input-stream.cc5
1 files changed, 4 insertions, 1 deletions
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);