Index: trunk/pswarp/src/pswarpTransformReadout.c
===================================================================
--- trunk/pswarp/src/pswarpTransformReadout.c	(revision 28548)
+++ trunk/pswarp/src/pswarpTransformReadout.c	(revision 31878)
@@ -110,4 +110,9 @@
     // Ensure threading is off for the covariance calculation, since we are threading on a different level.
     psImageCovarianceSetThreads(false);
+
+    psAssert (xGridMin >= 0, "xGridMin too small\n");
+    psAssert (yGridMin >= 0, "yGridMin too small\n");
+    psAssert (xGridMax < grid->nXpts, "xGridMax too big\n");
+    psAssert (yGridMax < grid->nYpts, "yGridMax too big\n");
 
     // create jobs and supply them to the threads
