Program: 67646
Project: 67646
Buggy source:
public void startImage(IImageContent image){
  IStyle style=image.getComputedStyle();
  InlineFlag inlineFlag=getInlineFlag(style);
  String uri=image.getURI();
  String mimeType=image.getMIMEType();
  String extension=image.getExtension();
  String altText=image.getAltText();
  double height=WordUtil.convertImageSize(image.getHeight(),0,reportDpi);
  double width=WordUtil.convertImageSize(image.getWidth(),0,reportDpi);
  context.addContainer(false);
  if (FlashFile.isFlash(mimeType,uri,extension)) {
    if (altText == null) {
      altText=messageFlashObjectNotSupported;
    }
    wordWriter.drawImage(null,height,width,null,style,inlineFlag,altText,uri);
    return;
  }
  try {
    Image imageInfo=EmitterUtil.parseImage(image,image.getImageSource(),uri,mimeType,extension);
    byte[] data=imageInfo.getData();
    if (data == null || data.length == 0) {
      wordWriter.drawImage(null,0.0,0.0,null,style,inlineFlag,altText,uri);
      return;
    }
    int imageFileWidthDpi=imageInfo.getPhysicalWidthDpi() == -1 ? 0 : imageInfo.getPhysicalWidthDpi();
    int imageFileHeightDpi=imageInfo.getPhysicalHeightDpi() == -1 ? 0 : imageInfo.getPhysicalHeightDpi();
    if (image.getHeight() == null) {
      height=WordUtil.convertImageSize(image.getHeight(),imageInfo.getHeight(),PropertyUtil.getImageDpi(image,imageFileHeightDpi,0));
    }
    if (image.getWidth() == null) {
      width=WordUtil.convertImageSize(image.getWidth(),imageInfo.getWidth(),PropertyUtil.getImageDpi(image,imageFileWidthDpi,0));
    }
    writeBookmark(image);
    writeToc(image);
    HyperlinkInfo hyper=getHyperlink(image);
    wordWriter.drawImage(data,height,width,hyper,style,inlineFlag,altText,uri);
  }
 catch (  IOException e) {
    logger.log(Level.WARNING,e.getLocalizedMessage());
    wordWriter.drawImage(null,height,width,null,style,inlineFlag,altText,uri);
  }
}

Fixed version (ground truth):
public void startImage(IImageContent image){
  IStyle style=image.getComputedStyle();
  InlineFlag inlineFlag=getInlineFlag(style);
  String uri=image.getURI();
  String mimeType=image.getMIMEType();
  String extension=image.getExtension();
  String altText=image.getAltText();
  double height=WordUtil.convertImageSize(image.getHeight(),0,reportDpi);
  int parentWidth=(int)(WordUtil.twipToPt(context.getCurrentWidth()) * reportDpi / 72);
  double width=WordUtil.convertImageSize(image.getWidth(),parentWidth,reportDpi);
  context.addContainer(false);
  if (FlashFile.isFlash(mimeType,uri,extension)) {
    if (altText == null) {
      altText=messageFlashObjectNotSupported;
    }
    wordWriter.drawImage(null,height,width,null,style,inlineFlag,altText,uri);
    return;
  }
  try {
    Image imageInfo=EmitterUtil.parseImage(image,image.getImageSource(),uri,mimeType,extension);
    byte[] data=imageInfo.getData();
    if (data == null || data.length == 0) {
      wordWriter.drawImage(null,0.0,0.0,null,style,inlineFlag,altText,uri);
      return;
    }
    int imageFileWidthDpi=imageInfo.getPhysicalWidthDpi() == -1 ? 0 : imageInfo.getPhysicalWidthDpi();
    int imageFileHeightDpi=imageInfo.getPhysicalHeightDpi() == -1 ? 0 : imageInfo.getPhysicalHeightDpi();
    if (image.getHeight() == null && image.getWidth() == null) {
      height=WordUtil.convertImageSize(image.getHeight(),imageInfo.getHeight(),PropertyUtil.getImageDpi(image,imageFileHeightDpi,0));
      width=WordUtil.convertImageSize(image.getWidth(),imageInfo.getWidth(),PropertyUtil.getImageDpi(image,imageFileWidthDpi,0));
    }
 else     if (image.getWidth() == null) {
      float scale=((float)imageInfo.getHeight()) / ((float)imageInfo.getWidth());
      width=height / scale;
    }
 else     if (image.getHeight() == null) {
      float scale=((float)imageInfo.getHeight()) / ((float)imageInfo.getWidth());
      height=width * scale;
    }
    writeBookmark(image);
    writeToc(image);
    HyperlinkInfo hyper=getHyperlink(image);
    wordWriter.drawImage(data,height,width,hyper,style,inlineFlag,altText,uri);
  }
 catch (  IOException e) {
    logger.log(Level.WARNING,e.getLocalizedMessage());
    wordWriter.drawImage(null,height,width,null,style,inlineFlag,altText,uri);
  }
}