Program: 90268
Project: 90268
Buggy source:
public void searchInImage(Context ctx,Bitmap image,float leftX,float leftY,float rightX,int rightY) throws Exception {
  if (null == mModel) {
    throw new Exception("String_Node_Str");
  }
  int leftEyeIndex=mModel.pathModel.paths[mModel.pathModel.paths.length - 2][0];
  int rightEyeIndex=mModel.pathModel.paths[mModel.pathModel.paths.length - 1][0];
  float meanLeftX=(float)((mModel.shapeModel.cvData.meanShape.get(leftEyeIndex * 2,0))[0]);
  float meanLeftY=(float)((mModel.shapeModel.cvData.meanShape.get(leftEyeIndex * 2 + 1,0))[0]);
  float meanRightX=(float)((mModel.shapeModel.cvData.meanShape.get(rightEyeIndex * 2,0))[0]);
  float meanRightY=(float)((mModel.shapeModel.cvData.meanShape.get(rightEyeIndex * 2 + 1,0))[0]);
  float meanAngle=(float)(Math.atan((meanRightY - meanLeftY) / (meanRightX - meanLeftX)));
  float currAngle=(float)(Math.atan((rightY - leftY) / (rightX - leftX)));
  float diffAngle=currAngle - meanAngle;
  float meanDist=(float)(Math.hypot(meanRightX - meanLeftX,meanRightY - meanLeftY));
  float currDist=(float)(Math.hypot(rightX - leftX,rightY - leftY));
  float scale=meanDist / currDist;
  mScaleFactor=scale;
  Bitmap imgProcess=Bitmap.createScaledBitmap(image,(int)(image.getWidth() * scale),(int)(image.getHeight() * scale),true);
  leftX*=scale;
  leftY*=scale;
  rightX*=scale;
  rightY*=scale;
  mCurrentParams.put(0,0,Math.cos(diffAngle));
  mCurrentParams.put(1,0,Math.sin(diffAngle));
  mCurrentParams.put(2,0,(rightX + leftX) / 2 - (meanRightX + meanLeftX) / 2);
  mCurrentParams.put(3,0,(rightY + leftY) / 2 - (meanRightY + meanLeftY) / 2);
  mImageW=imgProcess.getWidth();
  mImageH=imgProcess.getHeight();
  RenderScript rs=RenderScript.create(ctx);
  ScriptC_im2float script=new ScriptC_im2float(rs);
  Allocation inAlloc=Allocation.createFromBitmap(rs,imgProcess);
  Type.Builder tb=new Type.Builder(rs,Element.U8(rs));
  tb.setX(mImageW).setY(mImageH);
  mImgGrayScaled=new byte[mImageW * mImageH];
  Allocation outAlloc=Allocation.createTyped(rs,tb.create());
  script.forEach_root(inAlloc,outAlloc);
  outAlloc.copyTo(mImgGrayScaled);
  mCurrentPositions=getCurrentShape();
  mOriginalPositions=mCurrentPositions.clone();
}

Fixed version (ground truth):
public void searchInImage(Context ctx,Bitmap image,float leftX,float leftY,float rightX,float rightY) throws Exception {
  if (null == mModel) {
    throw new Exception("String_Node_Str");
  }
  int leftEyeIndex=mModel.pathModel.paths[mModel.pathModel.paths.length - 2][0];
  int rightEyeIndex=mModel.pathModel.paths[mModel.pathModel.paths.length - 1][0];
  float meanLeftX=(float)((mModel.shapeModel.cvData.meanShape.get(leftEyeIndex * 2,0))[0]);
  float meanLeftY=(float)((mModel.shapeModel.cvData.meanShape.get(leftEyeIndex * 2 + 1,0))[0]);
  float meanRightX=(float)((mModel.shapeModel.cvData.meanShape.get(rightEyeIndex * 2,0))[0]);
  float meanRightY=(float)((mModel.shapeModel.cvData.meanShape.get(rightEyeIndex * 2 + 1,0))[0]);
  float meanAngle=(float)(Math.atan((meanRightY - meanLeftY) / (meanRightX - meanLeftX)));
  float currAngle=(float)(Math.atan((rightY - leftY) / (rightX - leftX)));
  float diffAngle=currAngle - meanAngle;
  float meanDist=(float)(Math.hypot(meanRightX - meanLeftX,meanRightY - meanLeftY));
  float currDist=(float)(Math.hypot(rightX - leftX,rightY - leftY));
  float scale=meanDist / currDist;
  mScaleFactor=scale;
  Bitmap imgProcess=Bitmap.createScaledBitmap(image,(int)(image.getWidth() * scale),(int)(image.getHeight() * scale),true);
  leftX*=scale;
  leftY*=scale;
  rightX*=scale;
  rightY*=scale;
  mCurrentParams=new Mat(mModel.numEVectors + 4,1,CvType.CV_32F,new Scalar(0));
  mCurrentParams.put(0,0,Math.cos(diffAngle));
  mCurrentParams.put(1,0,Math.sin(diffAngle));
  mCurrentParams.put(2,0,(rightX + leftX) / 2 - (meanRightX + meanLeftX) / 2);
  mCurrentParams.put(3,0,(rightY + leftY) / 2 - (meanRightY + meanLeftY) / 2);
  mImageW=imgProcess.getWidth();
  mImageH=imgProcess.getHeight();
  RenderScript rs=RenderScript.create(ctx);
  ScriptC_im2float script=new ScriptC_im2float(rs);
  Allocation inAlloc=Allocation.createFromBitmap(rs,imgProcess);
  Type.Builder tb=new Type.Builder(rs,Element.U8(rs));
  tb.setX(mImageW).setY(mImageH);
  mImgGrayScaled=new byte[mImageW * mImageH];
  Allocation outAlloc=Allocation.createTyped(rs,tb.create());
  script.forEach_root(inAlloc,outAlloc);
  outAlloc.copyTo(mImgGrayScaled);
  mCurrentPositions=getCurrentShape();
  mOriginalPositions=mCurrentPositions.clone();
}