Program: 38141
Project: 38141
Buggy source:
public void init(StreamConfigurationMap map,int width,int height,Context context,OnMediaSavedListener mediaListener){
  Log.d(TAG,"String_Node_Str");
  mIsClosing=false;
  mImageProcessThread=new HandlerThread("String_Node_Str");
  mImageProcessThread.start();
  mClearsightRegisterThread=new HandlerThread("String_Node_Str");
  mClearsightRegisterThread.start();
  mClearsightProcessThread=new HandlerThread("String_Node_Str");
  mClearsightProcessThread.start();
  mImageEncodeThread=new HandlerThread("String_Node_Str");
  mImageEncodeThread.start();
  mImageProcessHandler=new ImageProcessHandler(mImageProcessThread.getLooper());
  mClearsightRegisterHandler=new ClearsightRegisterHandler(mClearsightRegisterThread.getLooper());
  mClearsightProcessHandler=new ClearsightProcessHandler(mClearsightProcessThread.getLooper());
  mImageEncodeHandler=new ImageEncodeHandler(mImageEncodeThread.getLooper());
  mFinalPictureSize=new Size(width,height);
  mFinalPictureRatio=(float)width / (float)height;
  mFinalMonoSize=getFinalMonoSize();
  Size maxSize=findMaxOutputSize(map);
  int maxWidth=maxSize.getWidth();
  int maxHeight=maxSize.getHeight();
  mImageReader[CAM_TYPE_BAYER]=createImageReader(CAM_TYPE_BAYER,maxWidth,maxHeight);
  mImageReader[CAM_TYPE_MONO]=createImageReader(CAM_TYPE_MONO,maxWidth,maxHeight);
  mEncodeImageReader[CAM_TYPE_BAYER]=createEncodeImageReader(CAM_TYPE_BAYER,maxWidth,maxHeight);
  mEncodeImageReader[CAM_TYPE_MONO]=createEncodeImageReader(CAM_TYPE_MONO,maxWidth,maxHeight);
  mMediaSavedListener=mediaListener;
  CameraManager cm=(CameraManager)context.getSystemService(Context.CAMERA_SERVICE);
  try {
    CameraCharacteristics cc=cm.getCameraCharacteristics("String_Node_Str");
    byte[] blob=cc.get(OTP_CALIB_BLOB);
    ClearSightNativeEngine.getInstance().init(mNumFrameCount * 2,width,height,CamSystemCalibrationData.createFromBytes(blob));
  }
 catch (  CameraAccessException e) {
    e.printStackTrace();
  }
  Log.d(TAG,"String_Node_Str");
}

Fixed version (ground truth):
public void init(StreamConfigurationMap map,int width,int height,Context context,OnMediaSavedListener mediaListener){
  Log.d(TAG,"String_Node_Str");
  mIsClosing=false;
  mImageProcessThread=new HandlerThread("String_Node_Str");
  mImageProcessThread.start();
  mClearsightRegisterThread=new HandlerThread("String_Node_Str");
  mClearsightRegisterThread.start();
  mClearsightProcessThread=new HandlerThread("String_Node_Str");
  mClearsightProcessThread.start();
  mImageEncodeThread=new HandlerThread("String_Node_Str");
  mImageEncodeThread.start();
  mImageProcessHandler=new ImageProcessHandler(mImageProcessThread.getLooper());
  mClearsightRegisterHandler=new ClearsightRegisterHandler(mClearsightRegisterThread.getLooper());
  mClearsightProcessHandler=new ClearsightProcessHandler(mClearsightProcessThread.getLooper());
  mImageEncodeHandler=new ImageEncodeHandler(mImageEncodeThread.getLooper());
  mFinalPictureSize=new Size(width,height);
  mFinalPictureRatio=(float)width / (float)height;
  mFinalMonoSize=getFinalMonoSize();
  Size maxSize=findMaxOutputSize(map);
  int maxWidth=maxSize.getWidth();
  int maxHeight=maxSize.getHeight();
  mImageReader[CAM_TYPE_BAYER]=createImageReader(CAM_TYPE_BAYER,maxWidth,maxHeight);
  mImageReader[CAM_TYPE_MONO]=createImageReader(CAM_TYPE_MONO,maxWidth,maxHeight);
  mEncodeImageReader[CAM_TYPE_BAYER]=createEncodeImageReader(CAM_TYPE_BAYER,maxWidth,maxHeight);
  mEncodeImageReader[CAM_TYPE_MONO]=createEncodeImageReader(CAM_TYPE_MONO,maxWidth,maxHeight);
  mMediaSavedListener=mediaListener;
  CameraManager cm=(CameraManager)context.getSystemService(Context.CAMERA_SERVICE);
  try {
    CameraCharacteristics cc=cm.getCameraCharacteristics("String_Node_Str");
    byte[] blob=cc.get(OTP_CALIB_BLOB);
    ClearSightNativeEngine.getInstance().init(mNumFrameCount * 2,maxWidth,maxHeight,CamSystemCalibrationData.createFromBytes(blob));
  }
 catch (  CameraAccessException e) {
    e.printStackTrace();
  }
  Log.d(TAG,"String_Node_Str");
}