Program: 172625
Project: 172625
Buggy source:
@Override public void surfaceChanged(SurfaceHolder surfaceHolder,final int format,final int width,final int height){
  mWidth=width;
  mHeight=height;
  for (int b=0; b < bgs.length; b++) {
    int bgw=bgs[b].getWidth();
    int bgh=bgs[b].getHeight();
    int bgw2=(int)(bgw / (double)bgh * mHeight);
    Rect src=new Rect(bgw > mWidth ? Utils.getRand(bgw - mWidth - 1) : 0,0,bgw,bgh);
    Rect dest=new Rect(0,0,bgw2,mHeight);
    bgsScaled[b]=Bitmap.createBitmap(mWidth,mHeight,Bitmap.Config.ARGB_8888);
    Canvas c=new Canvas(bgsScaled[b]);
    c.drawBitmap(bgs[b],src,dest,null);
  }
  for (int b=0; b < fgtops.length; b++) {
    int bgw=fgtops[b].getWidth();
    int bgh=fgtops[b].getHeight();
    int bgh2=(int)(bgh / (double)bgw * mWidth);
    Rect src=new Rect(0,0,bgw,bgh);
    Rect dest=new Rect(0,0,mWidth,bgh2);
    fgtopsScaled[b]=Bitmap.createBitmap(mWidth,bgh2,Bitmap.Config.ARGB_8888);
    Canvas c=new Canvas(fgtopsScaled[b]);
    c.drawBitmap(fgtops[b],src,dest,null);
  }
  for (int b=0; b < fgbottoms.length; b++) {
    int bgw=fgbottoms[b].getWidth();
    int bgh=fgbottoms[b].getHeight();
    int bgh2=(int)(bgh / (double)bgw * mWidth);
    Rect src=new Rect(0,0,bgw,bgh);
    Rect dest=new Rect(0,0,mWidth,bgh2);
    fgbottomsScaled[b]=Bitmap.createBitmap(mWidth,bgh2,Bitmap.Config.ARGB_8888);
    Canvas c=new Canvas(fgbottomsScaled[b]);
    c.drawBitmap(fgbottoms[b],src,dest,null);
  }
  Log.d("String_Node_Str",mWidth + "String_Node_Str" + mHeight);
  mThread=new RunThread(surfaceHolder);
  mThread.start();
}

Fixed version (ground truth):
@Override public void surfaceChanged(SurfaceHolder surfaceHolder,final int format,final int width,final int height){
  mWidth=width;
  mHeight=height;
  for (int b=0; b < bgs.length; b++) {
    int bgw=bgs[b].getWidth();
    int bgh=bgs[b].getHeight();
    int bgw2=(int)(bgw / (double)bgh * mHeight);
    Rect src=new Rect(bgw > mWidth ? Utils.getRand(bgw - mWidth - 1) : 0,0,bgw,bgh);
    Rect dest=new Rect(0,0,b == 0 ? mWidth : bgw2,mHeight);
    bgsScaled[b]=Bitmap.createBitmap(mWidth,mHeight,Bitmap.Config.ARGB_8888);
    Canvas c=new Canvas(bgsScaled[b]);
    c.drawBitmap(bgs[b],src,dest,null);
  }
  for (int b=0; b < fgtops.length; b++) {
    int bgw=fgtops[b].getWidth();
    int bgh=fgtops[b].getHeight();
    int bgh2=(int)(bgh / (double)bgw * mWidth);
    Rect src=new Rect(0,0,bgw,bgh);
    Rect dest=new Rect(0,0,mWidth,bgh2);
    fgtopsScaled[b]=Bitmap.createBitmap(mWidth,bgh2,Bitmap.Config.ARGB_8888);
    Canvas c=new Canvas(fgtopsScaled[b]);
    c.drawBitmap(fgtops[b],src,dest,null);
  }
  for (int b=0; b < fgbottoms.length; b++) {
    int bgw=fgbottoms[b].getWidth();
    int bgh=fgbottoms[b].getHeight();
    int bgh2=(int)(bgh / (double)bgw * mWidth);
    Rect src=new Rect(0,0,bgw,bgh);
    Rect dest=new Rect(0,0,mWidth,bgh2);
    fgbottomsScaled[b]=Bitmap.createBitmap(mWidth,bgh2,Bitmap.Config.ARGB_8888);
    Canvas c=new Canvas(fgbottomsScaled[b]);
    c.drawBitmap(fgbottoms[b],src,dest,null);
  }
  Log.d("String_Node_Str",mWidth + "String_Node_Str" + mHeight);
  if (mThread != null) {
    mThread.stopRunning();
  }
  mThread=new RunThread(surfaceHolder);
  mThread.start();
}