Program: 154031
Project: 154031
Buggy source:
/** 
 * Performs the "grid warp" operation on a rectangular region of the image.
 */
protected void computeRect(Raster[] sources,WritableRaster dest,Rectangle destRect){
  int formatTag=MediaLibAccessor.findCompatibleTag(sources,dest);
  Raster source=sources[0];
  MediaLibAccessor srcMA=new MediaLibAccessor(source,source.getBounds(),formatTag);
  MediaLibAccessor dstMA=new MediaLibAccessor(dest,destRect,formatTag);
  mediaLibImage[] srcMLI=srcMA.getMediaLibImages();
  mediaLibImage[] dstMLI=dstMA.getMediaLibImages();
switch (dstMA.getDataType()) {
case DataBuffer.TYPE_BYTE:
case DataBuffer.TYPE_USHORT:
case DataBuffer.TYPE_SHORT:
case DataBuffer.TYPE_INT:
    if (setBackground)     for (int i=0; i < dstMLI.length; i++) {
      Image.GridWarp2(dstMLI[i],srcMLI[i],xWarpPos,yWarpPos,source.getMinX(),source.getMinY(),xStart - destRect.x,xStep,xNumCells,yStart - destRect.y,yStep,yNumCells,filter,Constants.MLIB_EDGE_DST_NO_WRITE,intBackgroundValues);
    }
 else     for (int i=0; i < dstMLI.length; i++) {
      Image.GridWarp(dstMLI[i],srcMLI[i],xWarpPos,yWarpPos,source.getMinX(),source.getMinY(),xStart - destRect.x,xStep,xNumCells,yStart - destRect.y,yStep,yNumCells,filter,Constants.MLIB_EDGE_DST_NO_WRITE);
    }
  break;
case DataBuffer.TYPE_FLOAT:
case DataBuffer.TYPE_DOUBLE:
if (setBackground) for (int i=0; i < dstMLI.length; i++) {
  Image.GridWarp2_Fp(dstMLI[i],srcMLI[i],xWarpPos,yWarpPos,source.getMinX(),source.getMinY(),xStart - destRect.x,xStep,xNumCells,yStart - destRect.y,yStep,yNumCells,filter,Constants.MLIB_EDGE_DST_NO_WRITE,backgroundValues);
}
 else for (int i=0; i < dstMLI.length; i++) {
  Image.GridWarp_Fp(dstMLI[i],srcMLI[i],xWarpPos,yWarpPos,source.getMinX(),source.getMinY(),xStart - destRect.x,xStep,xNumCells,yStart - destRect.y,yStep,yNumCells,filter,Constants.MLIB_EDGE_DST_NO_WRITE);
}
break;
default :
throw new RuntimeException(JaiI18N.getString("String_Node_Str"));
}
if (dstMA.isDataCopy()) {
dstMA.clampDataArrays();
dstMA.copyDataToRaster();
}
}

Fixed version (ground truth):
/** 
 * Performs the "grid warp" operation on a rectangular region of the image.
 */
protected void computeRect(Raster[] sources,WritableRaster dest,Rectangle destRect){
  int formatTag=MediaLibAccessor.findCompatibleTag(sources,dest);
  Raster source=sources[0];
  MediaLibAccessor srcMA=new MediaLibAccessor(source,source.getBounds(),formatTag);
  MediaLibAccessor dstMA=new MediaLibAccessor(dest,destRect,formatTag);
  mediaLibImage[] srcMLI=srcMA.getMediaLibImages();
  mediaLibImage[] dstMLI=dstMA.getMediaLibImages();
switch (dstMA.getDataType()) {
case DataBuffer.TYPE_BYTE:
case DataBuffer.TYPE_USHORT:
case DataBuffer.TYPE_SHORT:
case DataBuffer.TYPE_INT:
    if (setBackground)     for (int i=0; i < dstMLI.length; i++) {
      Image.GridWarp2(dstMLI[i],srcMLI[i],xWarpPos,yWarpPos,source.getMinX(),source.getMinY(),xStart - destRect.x,xStep,xNumCells,yStart - destRect.y,yStep,yNumCells,filter,Constants.MLIB_EDGE_DST_NO_WRITE,intBackgroundValues);
    }
 else     for (int i=0; i < dstMLI.length; i++) {
      Image.GridWarp(dstMLI[i],srcMLI[i],xWarpPos,yWarpPos,source.getMinX(),source.getMinY(),xStart - destRect.x,xStep,xNumCells,yStart - destRect.y,yStep,yNumCells,filter,Constants.MLIB_EDGE_DST_NO_WRITE);
      MlibUtils.clampImage(dstMLI[i],getColorModel());
    }
  break;
case DataBuffer.TYPE_FLOAT:
case DataBuffer.TYPE_DOUBLE:
if (setBackground) for (int i=0; i < dstMLI.length; i++) {
  Image.GridWarp2_Fp(dstMLI[i],srcMLI[i],xWarpPos,yWarpPos,source.getMinX(),source.getMinY(),xStart - destRect.x,xStep,xNumCells,yStart - destRect.y,yStep,yNumCells,filter,Constants.MLIB_EDGE_DST_NO_WRITE,backgroundValues);
}
 else for (int i=0; i < dstMLI.length; i++) {
  Image.GridWarp_Fp(dstMLI[i],srcMLI[i],xWarpPos,yWarpPos,source.getMinX(),source.getMinY(),xStart - destRect.x,xStep,xNumCells,yStart - destRect.y,yStep,yNumCells,filter,Constants.MLIB_EDGE_DST_NO_WRITE);
}
break;
default :
throw new RuntimeException(JaiI18N.getString("String_Node_Str"));
}
if (dstMA.isDataCopy()) {
dstMA.clampDataArrays();
dstMA.copyDataToRaster();
}
}