summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'base/gxclread.c')
-rw-r--r--base/gxclread.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/base/gxclread.c b/base/gxclread.c
index 03945e81..b17d5a1e 100644
--- a/base/gxclread.c
+++ b/base/gxclread.c
@@ -294,6 +294,12 @@ buffer_segment_index(const stream_band_read_state *ss, uint buffer_offset, uint
return i;
}
}
+ /* Now cope with the case where we've read exactly to the end of the buffer.
+ * There might be more data still to come. */
+ if (buffer_offset == offset) {
+ *poffset0 = offset0;
+ return i-1;
+ }
#ifdef EXTRA_OFFSET_MAP_DEBUGGING
dmlprintf1(ss->local_memory, "buffer_segment_index fail: buffer_offset=%d not found\n", buffer_offset);
exit(1);