diff
--- a/libtiff/tif_ps.c
+++ b/libtiff/tif_ps.c
@@ -57,10 +57,11 @@
                                  case 1: c = *cp++; PUTHEX(c,fd);
                                  }
                                  cp += es;
-                                 if (cp >= tf_buf + tf_bytesperrow) {
-                                    TIFFError(filename, "Out of bounds access in color channel processing.");
-                                    _TIFFfree((char *) tf_buf);
-                                    return;
+                                 if (cp > tf_buf + tf_bytesperrow || cp < tf_buf) {
+                                        TIFFError(filename, 
+                                                  "Invalid color channel configuration. "
+                                                  "Pointer is out of bounds.");
+                                        _TIFFfree((char *) tf_buf);
+                                        return;
                                     TIFFError(filename, "Color channel configuration error");
                                 }
 58                         }

