summaryrefslogtreecommitdiff
path: root/base/gxclrast.c
diff options
context:
space:
mode:
Diffstat (limited to 'base/gxclrast.c')
-rw-r--r--base/gxclrast.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/base/gxclrast.c b/base/gxclrast.c
index 26211e7aa..17bcca2b5 100644
--- a/base/gxclrast.c
+++ b/base/gxclrast.c
@@ -160,8 +160,8 @@ top_up_cbuf(command_buf_t *pcb, const byte **pcbp)
stream_state *st = pcb->s->state;
# endif
- if (pcb->end - cbp >= pcb->size) {
- errprintf(pcb->s->memory, "Clist I/O error: cbp past end of buffer\n");
+ if (cbp < pcb->data || cbp > pcb->end) {
+ errprintf(pcb->s->memory, "Clist I/O error: cbp outside of buffer\n");
return (gs_error_ioerror);
}