Program: 66685
Project: 66685
Buggy source:
public void addImageData(IImageContent image,IStyle style,HyperlinkDef link,BookmarkDef bookmark){
  XlsContainer container=getCurrentContainer();
  if (container == null) {
    return;
  }
  ContainerSizeInfo parentSizeInfo=container.getSizeInfo();
  int imageWidthDpi=context.getDpi();
  int imageHeightDpi=context.getDpi();
  int imageHeight;
  int imageWidth;
  byte[] imageData=null;
  try {
    Image imageInfo=EmitterUtil.parseImage(image,image.getImageSource(),image.getURI(),image.getMIMEType(),image.getExtension());
    imageData=imageInfo.getData();
    int[] imageSize=getImageSize(image,imageInfo,parentSizeInfo,imageWidthDpi,imageHeightDpi);
    imageHeight=imageSize[0];
    imageWidth=imageSize[1];
  }
 catch (  IOException ex) {
    imageHeight=LayoutUtil.getImageHeight(image.getHeight(),0,imageHeightDpi);
    imageWidth=LayoutUtil.getImageWidth(image.getWidth(),parentSizeInfo.getWidth(),0,imageWidthDpi);
  }
  ColumnsInfo imageColumnsInfo=LayoutUtil.createImage(imageWidth);
  splitColumns(imageColumnsInfo,parentSizeInfo);
  ContainerSizeInfo imageSize=new ContainerSizeInfo(parentSizeInfo.getStartCoordinate(),imageColumnsInfo.getTotalWidth());
  StyleEntry entry=engine.getStyle(style,imageSize,parentSizeInfo,getParentStyle(container));
  setlinkStyle(entry,link);
  SheetData data=createImageData(image,imageData,imageSize.getWidth(),imageHeight,entry,container);
  data.setHyperlinkDef(link);
  data.setBookmark(bookmark);
  data.setStartX(imageSize.getStartCoordinate());
  data.setEndX(imageSize.getEndCoordinate());
  addData(data,container);
}

Fixed version (ground truth):
public void addImageData(IImageContent image,IStyle style,HyperlinkDef link,BookmarkDef bookmark){
  XlsContainer container=getCurrentContainer();
  if (container == null) {
    return;
  }
  ContainerSizeInfo parentSizeInfo=container.getSizeInfo();
  int imageWidthDpi=context.getDpi();
  int imageHeightDpi=context.getDpi();
  int imageHeight;
  int imageWidth;
  byte[] imageData=null;
  try {
    Image imageInfo=EmitterUtil.parseImage(image,image.getImageSource(),image.getURI(),image.getMIMEType(),image.getExtension());
    imageData=imageInfo.getData();
    int[] imageSize=getImageSize(image,imageInfo,parentSizeInfo,imageWidthDpi,imageHeightDpi);
    imageHeight=imageSize[0];
    imageWidth=imageSize[1];
  }
 catch (  IOException ex) {
    imageHeight=LayoutUtil.getImageHeight(image.getHeight(),0,imageHeightDpi);
    imageWidth=LayoutUtil.getImageWidth(image.getWidth(),parentSizeInfo.getWidth(),0,imageWidthDpi);
  }
  ColumnsInfo imageColumnsInfo=LayoutUtil.createImage(imageWidth);
  int[] imageCoordinates=splitColumns(imageColumnsInfo,parentSizeInfo);
  ContainerSizeInfo imageSize=new ContainerSizeInfo(imageCoordinates[0],imageColumnsInfo.getTotalWidth());
  StyleEntry entry=engine.getStyle(style,imageSize,parentSizeInfo,getParentStyle(container));
  setlinkStyle(entry,link);
  SheetData data=createImageData(image,imageData,imageSize.getWidth(),imageHeight,entry,container);
  data.setHyperlinkDef(link);
  data.setBookmark(bookmark);
  data.setStartX(imageSize.getStartCoordinate());
  data.setEndX(imageSize.getEndCoordinate());
  addData(data,container);
}