Program: 70265
Project: 70265
Buggy source:
/** 
 * Draws the background image at the contentByteUnder of the PPT with the given offset
 * @param imageURI the URI referring the image
 * @param x the start X coordinate at the PPT where the image is positioned
 * @param y the start Y coordinate at the PPT where the image is positioned
 * @param width the width of the background dimension
 * @param height the height of the background dimension
 * @param positionX the offset X percentage relating to start X
 * @param positionY the offset Y percentage relating to start Y
 * @param repeat the background-repeat property
 * @param xMode whether the horizontal position is a percentage value or not
 * @param yMode whether the vertical position is a percentage value or not
 */
public void drawBackgroundImage(String imageURI,float x,float y,float width,float height,float positionX,float positionY,int repeat){
  if (imageURI == null || imageURI.length() == 0) {
    return;
  }
  float imageWidth=0;
  float imageHeight=0;
  byte[] imageData=null;
  InputStream imageStream=null;
  try {
    URL url=new URL(imageURI);
    imageStream=url.openStream();
    imageData=getImageData(imageStream);
    imageStream.close();
    imageStream=url.openStream();
    Image image=ImageIO.read(imageStream);
    ImageIcon imageIcon=new ImageIcon(image);
    imageWidth=imageIcon.getIconWidth();
    imageHeight=imageIcon.getIconHeight();
  }
 catch (  IOException ioe) {
    logger.log(Level.WARNING,ioe.getMessage(),ioe);
  }
 finally {
    if (imageStream != null) {
      try {
        imageStream.close();
      }
 catch (      IOException e) {
      }
    }
  }
  String extension=getImageExtension(imageURI);
  ImageInfo imageInfo=getImageInfo(imageURI,imageData,extension);
  Position areaPosition=new Position(x,y);
  Position areaSize=new Position(width,height);
  Position imagePosition=new Position(x + positionX,y + positionY);
  Position imageSize=new Position(imageWidth,imageHeight);
  BackgroundImageLayout layout=new BackgroundImageLayout(areaPosition,areaSize,imagePosition,imageSize);
  Collection positions=layout.getImagePositions(repeat);
  Iterator iterator=positions.iterator();
  while (iterator.hasNext()) {
    Position position=(Position)iterator.next();
    exportImageDefn(imageInfo.imageName,imageInfo.imageId,imageWidth,imageHeight,position.getX(),position.getY(),null);
  }
}

Fixed version (ground truth):
/** 
 * Draws the background image at the contentByteUnder of the PPT with the given offset
 * @param imageURI the URI referring the image
 * @param x the start X coordinate at the PPT where the image is positioned
 * @param y the start Y coordinate at the PPT where the image is positioned
 * @param width the width of the background dimension
 * @param height the height of the background dimension
 * @param positionX the offset X percentage relating to start X
 * @param positionY the offset Y percentage relating to start Y
 * @param repeat the background-repeat property
 * @param xMode whether the horizontal position is a percentage value or not
 * @param yMode whether the vertical position is a percentage value or not
 */
public void drawBackgroundImage(String imageURI,float x,float y,float width,float height,float iWidth,float iHeight,float positionX,float positionY,int repeat){
  if (imageURI == null || imageURI.length() == 0) {
    return;
  }
  float imageWidth=iWidth;
  float imageHeight=iHeight;
  byte[] imageData=null;
  InputStream imageStream=null;
  try {
    URL url=new URL(imageURI);
    imageStream=url.openStream();
    imageData=getImageData(imageStream);
    imageStream.close();
    imageStream=url.openStream();
    Image image=ImageIO.read(imageStream);
    ImageIcon imageIcon=new ImageIcon(image);
    if (imageWidth == 0 || imageHeight == 0) {
      imageWidth=imageIcon.getIconWidth();
      imageHeight=imageIcon.getIconHeight();
    }
  }
 catch (  IOException ioe) {
    logger.log(Level.WARNING,ioe.getMessage(),ioe);
  }
 finally {
    if (imageStream != null) {
      try {
        imageStream.close();
      }
 catch (      IOException e) {
      }
    }
  }
  String extension=getImageExtension(imageURI);
  ImageInfo imageInfo=getImageInfo(imageURI,imageData,extension);
  Position areaPosition=new Position(x,y);
  Position areaSize=new Position(width,height);
  Position imagePosition=new Position(x + positionX,y + positionY);
  Position imageSize=new Position(imageWidth,imageHeight);
  BackgroundImageLayout layout=new BackgroundImageLayout(areaPosition,areaSize,imagePosition,imageSize);
  Collection positions=layout.getImagePositions(repeat);
  Iterator iterator=positions.iterator();
  while (iterator.hasNext()) {
    Position position=(Position)iterator.next();
    exportImageDefn(imageInfo.imageName,imageInfo.imageId,imageWidth,imageHeight,position.getX(),position.getY(),null);
  }
}