Index: branches/pap/psLib/src/jpeg/psImageJpeg.c
===================================================================
--- branches/pap/psLib/src/jpeg/psImageJpeg.c	(revision 23948)
+++ branches/pap/psLib/src/jpeg/psImageJpeg.c	(revision 25027)
@@ -202,10 +202,13 @@
             if (isfinite(row[i])) {
                 pixel = PS_JPEG_SCALEVALUE(row[i],zero,scale);
+		outPix[0] = Rpix[pixel];
+		outPix[1] = Gpix[pixel];
+		outPix[2] = Bpix[pixel];
             } else {
-                pixel = 0;
-            }
-            outPix[0] = Rpix[pixel];
-            outPix[1] = Gpix[pixel];
-            outPix[2] = Bpix[pixel];
+		// XXX NAN value should be set per-color map
+		outPix[0] = 0xff;
+		outPix[1] = 0x00;
+		outPix[2] = 0xff;
+	    }
         }
         jpeg_write_scanlines(&cinfo, jpegLineList, 1);
