Index: trunk/pstamp/src/ppstampMakeStamp.c
===================================================================
--- trunk/pstamp/src/ppstampMakeStamp.c	(revision 26289)
+++ trunk/pstamp/src/ppstampMakeStamp.c	(revision 27117)
@@ -394,4 +394,13 @@
     double dy = 0.5 * options->roip.dDEC / fpa->toSky->Ys;
 
+    if (dx > 5000) {
+        fprintf(stderr, "requested width %f too large reducing to 5000\n", dx);
+        dx = 5000;
+    }
+    if (dy > 5000) {
+        fprintf(stderr, "requested height %f too large reducing to 5000\n", dy);
+        dy = 5000;
+    }
+
     pt->TP->xErr = 0;
     pt->TP->yErr = 0;
@@ -497,4 +506,12 @@
             int width  = options->roip.dX;
             int height = options->roip.dY;
+            if (width > 5000) {
+                fprintf(stderr, "requested width %d too large reducing to 5000\n", width);
+                width = 5000;
+            }
+            if (height > 5000) {
+                fprintf(stderr, "requested height %d too large reducing to 5000\n", height);
+                height = 5000;
+            }
 
             // calculate the ROI in chip coordinates
