diff --git a/filter/rastertoepson.c b/filter/rastertoepson.c
index 73e8d0600..4522e6b48 100644
--- a/filter/rastertoepson.c
+++ b/filter/rastertoepson.c
@@ -301,7 +302,7 @@ StartPage(
 
   if (DotBytes)
   {
-    if ((LineBuffers[0] = calloc((size_t)DotBytes, header->cupsWidth * (size_t)(Shingling + 1))) == NULL)
+    if ((LineBuffers[0] = calloc((size_t)DotBytes, (header->cupsWidth + 7) * (size_t)(Shingling + 1))) == NULL)
     {
       fputs("ERROR: Unable to allocate memory\n", stderr);
       exit(1);
