Program: 26232
Project: 26232
Buggy source:
/** 
 * Build the image pyramid.
 */
private void buildImagePyramid(){
  int fullWidth;
  int fullHeight;
  double[] fullDual=new double[width * height];
  int halfWidth=width;
  int halfHeight=height;
  cardinalToDual2D(image,fullDual,width,height,3);
  int extraSteps=(int)Math.round(Math.log((double)this.maxImageSubsamplingFactor) / Math.log(2));
  for (int depth=1; ((depth <= (pyramidDepth + extraSteps)) && (!t.isInterrupted())); depth++) {
    IJ.showStatus("String_Node_Str");
    IJ.showProgress((double)depth / (pyramidDepth + extraSteps));
    fullWidth=halfWidth;
    fullHeight=halfHeight;
    halfWidth/=2;
    halfHeight/=2;
    if (fullWidth <= BSplineModel.min_image_size || fullHeight <= BSplineModel.min_image_size) {
      if (this.bSubsampledOutput)       IJ.log("String_Node_Str" + fullWidth + "String_Node_Str"+ fullHeight);
      imgpyramid.push(fullDual);
      imgpyramid.push(new Integer(fullHeight));
      imgpyramid.push(new Integer(fullWidth));
      halfWidth*=2;
      halfHeight*=2;
      continue;
    }
    final double[] halfDual=getHalfDual2D(fullDual,fullWidth,fullHeight);
    final double[] halfImage=new double[halfWidth * halfHeight];
    dualToCardinal2D(halfDual,halfImage,halfWidth,halfHeight,3);
    if (depth >= extraSteps) {
      if (this.bSubsampledOutput)       IJ.log("String_Node_Str" + halfWidth + "String_Node_Str"+ halfHeight);
      imgpyramid.push(halfImage);
      imgpyramid.push(new Integer(halfHeight));
      imgpyramid.push(new Integer(halfWidth));
    }
    fullDual=halfDual;
    if (this.bSubsampledOutput && halfWidth == this.subWidth) {
      this.subImage=halfDual;
    }
  }
  while (halfWidth > this.subWidth) {
    fullWidth=halfWidth;
    fullHeight=halfHeight;
    halfWidth/=2;
    halfHeight/=2;
    final double[] halfDual=getHalfDual2D(fullDual,fullWidth,fullHeight);
    final double[] halfImage=new double[halfWidth * halfHeight];
    dualToCardinal2D(halfDual,halfImage,halfWidth,halfHeight,3);
    fullDual=halfDual;
    if (this.bSubsampledOutput && halfWidth == this.subWidth) {
      this.subImage=halfDual;
    }
  }
}

Fixed version (ground truth):
/** 
 * Build the image pyramid.
 */
private void buildImagePyramid(){
  int fullWidth;
  int fullHeight;
  double[] fullDual=new double[width * height];
  int halfWidth=width;
  int halfHeight=height;
  cardinalToDual2D(image,fullDual,width,height,3);
  for (int depth=1; depth <= pyramidDepth && !t.isInterrupted(); depth++) {
    IJ.showStatus("String_Node_Str");
    IJ.showProgress((double)depth / pyramidDepth);
    fullWidth=halfWidth;
    fullHeight=halfHeight;
    halfWidth/=2;
    halfHeight/=2;
    if (fullWidth <= BSplineModel.min_image_size || fullHeight <= BSplineModel.min_image_size) {
      if (this.bSubsampledOutput)       IJ.log("String_Node_Str" + fullWidth + "String_Node_Str"+ fullHeight);
      imgpyramid.push(fullDual);
      imgpyramid.push(new Integer(fullHeight));
      imgpyramid.push(new Integer(fullWidth));
      halfWidth*=2;
      halfHeight*=2;
      continue;
    }
    final double[] halfDual=getHalfDual2D(fullDual,fullWidth,fullHeight);
    final double[] halfImage=new double[halfWidth * halfHeight];
    dualToCardinal2D(halfDual,halfImage,halfWidth,halfHeight,3);
    if (this.bSubsampledOutput)     IJ.log("String_Node_Str" + halfWidth + "String_Node_Str"+ halfHeight);
    imgpyramid.push(halfImage);
    imgpyramid.push(new Integer(halfHeight));
    imgpyramid.push(new Integer(halfWidth));
    fullDual=halfDual;
    if (this.bSubsampledOutput && halfWidth == this.subWidth) {
      this.subImage=halfDual;
    }
  }
  while (halfWidth > this.subWidth) {
    fullWidth=halfWidth;
    fullHeight=halfHeight;
    halfWidth/=2;
    halfHeight/=2;
    final double[] halfDual=getHalfDual2D(fullDual,fullWidth,fullHeight);
    final double[] halfImage=new double[halfWidth * halfHeight];
    dualToCardinal2D(halfDual,halfImage,halfWidth,halfHeight,3);
    fullDual=halfDual;
    if (this.bSubsampledOutput && halfWidth == this.subWidth) {
      this.subImage=halfDual;
    }
  }
}