Program: 68355
Project: 68355
Buggy source:
/** 
 * Calculates the absolute positions of image map when given the position of image. The image map position is relative to the left up corner of the image. The argument and returned value are both 4 length integer area, the four value of which are x, y of up left corner, width and height respectively.
 * @param vertex the vertex coordinates.
 * @param imageArea image area of the image in which the image map is.
 * @return absolute position of the image map.
 */
private int[] getAbsoluteVertices(int[] vertex,IImageArea imageArea){
  assert(intrinsic != null);
  int[] result=null;
  int imageHeight=imageArea.getHeight();
  int imageWidth=imageArea.getWidth();
  int intrinsicWidth=intrinsic.getWidth();
  int intrinsicHeight=intrinsic.getHeight();
  float ratioX=(float)imageWidth / (float)intrinsicWidth;
  float ratioY=(float)imageHeight / (float)intrinsicHeight;
  int imageX=imageArea.getX();
  int imageY=imageArea.getY();
  if ("String_Node_Str".equalsIgnoreCase(context.getFormat())) {
    result=new int[vertex.length];
    for (int i=0; i < vertex.length; ) {
      result[i]=imageX + (int)(getTranslatedLengthX(vertex[i]) * ratioX);
      i++;
      result[i]=imageY + (int)(getTranslatedLengthY(vertex[i]) * ratioY);
      i++;
    }
  }
 else {
    for (int i=0; i < 4; ) {
      vertex[i]=getTranslatedLengthX(vertex[i]);
      i++;
      vertex[i]=getTranslatedLengthY(vertex[i]);
      i++;
    }
    result=new int[4];
    result[0]=imageX + (int)(vertex[0] * ratioX);
    result[1]=imageY + (int)(vertex[1] * ratioY);
    result[2]=(int)(vertex[2] * ratioX);
    result[3]=(int)(vertex[3] * ratioY);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Calculates the absolute positions of image map when given the position of image. The image map position is relative to the left up corner of the image. The argument and returned value are both 4 length integer area, the four value of which are x, y of up left corner, width and height respectively.
 * @param vertex the vertex coordinates.
 * @param imageArea image area of the image in which the image map is.
 * @return absolute position of the image map.
 */
private int[] getAbsoluteVertices(int[] vertex,IImageArea imageArea){
  int[] result=null;
  float ratioX=1.0f;
  float ratioY=1.0f;
  if (intrinsic != null) {
    int imageHeight=imageArea.getHeight();
    int imageWidth=imageArea.getWidth();
    int intrinsicWidth=intrinsic.getWidth();
    int intrinsicHeight=intrinsic.getHeight();
    ratioX=(float)imageWidth / (float)intrinsicWidth;
    ratioY=(float)imageHeight / (float)intrinsicHeight;
  }
  int imageX=imageArea.getX();
  int imageY=imageArea.getY();
  if ("String_Node_Str".equalsIgnoreCase(context.getFormat())) {
    result=new int[vertex.length];
    for (int i=0; i < vertex.length; ) {
      result[i]=imageX + (int)(getTranslatedLengthX(vertex[i]) * ratioX);
      i++;
      result[i]=imageY + (int)(getTranslatedLengthY(vertex[i]) * ratioY);
      i++;
    }
  }
 else {
    for (int i=0; i < 4; ) {
      vertex[i]=getTranslatedLengthX(vertex[i]);
      i++;
      vertex[i]=getTranslatedLengthY(vertex[i]);
      i++;
    }
    result=new int[4];
    result[0]=imageX + (int)(vertex[0] * ratioX);
    result[1]=imageY + (int)(vertex[1] * ratioY);
    result[2]=(int)(vertex[2] * ratioX);
    result[3]=(int)(vertex[3] * ratioY);
  }
  return result;
}