Program: 150596
Project: 150596
Buggy source:
public static InterleavedU8 yuvToInterleavedYuvU8(Image yuv,InterleavedU8 output,byte work[]){
  int width=yuv.getWidth();
  int height=yuv.getHeight();
  if (output != null) {
    output.setNumberOfBands(3);
    output.reshape(width,height);
  }
 else {
    output=new InterleavedU8(width,height,3);
  }
  Image.Plane planes[]=yuv.getPlanes();
  int workLength=planes[0].getRowStride() + planes[1].getRowStride() + planes[2].getRowStride();
  if (work.length < workLength)   throw new IllegalArgumentException("String_Node_Str" + workLength);
  ByteBuffer bufferY=planes[0].getBuffer();
  ByteBuffer bufferU=planes[2].getBuffer();
  ByteBuffer bufferV=planes[1].getBuffer();
  bufferY.position(0);
  bufferU.position(0);
  bufferV.position(0);
  int strideY=planes[0].getRowStride();
  int strideU=planes[1].getRowStride();
  int strideV=planes[2].getRowStride();
  int offsetU=strideY;
  int offsetV=strideY + offsetU;
  int stridePixelUV=planes[1].getPixelStride();
  for (int y=0, indexOut=0; y < height; y++) {
    bufferY.get(work,0,strideY);
    if (y % stridePixelUV == 0) {
      bufferU.get(work,offsetU,Math.min(bufferU.remaining(),strideU));
      bufferV.get(work,offsetV,Math.min(bufferV.remaining(),strideV));
    }
    int indexY=0;
    int indexU=offsetU;
    int indexV=offsetV;
    for (int x=0; x < width; x++, indexY++) {
      output.data[indexOut++]=work[indexY];
      output.data[indexOut++]=work[indexU];
      output.data[indexOut++]=work[indexV];
      int stepUV=stridePixelUV * (((x + stridePixelUV - 1) % stridePixelUV) ^ 1);
      indexU+=stepUV;
      indexV+=stepUV;
    }
  }
  return output;
}

Fixed version (ground truth):
public static InterleavedU8 yuvToInterleavedYuvU8(Image yuv,InterleavedU8 output,byte work[]){
  int width=yuv.getWidth();
  int height=yuv.getHeight();
  if (output != null) {
    output.setNumberOfBands(3);
    output.reshape(width,height);
  }
 else {
    output=new InterleavedU8(width,height,3);
  }
  Image.Plane planes[]=yuv.getPlanes();
  int strideY=planes[0].getRowStride();
  int strideU=planes[2].getRowStride();
  int strideV=planes[1].getRowStride();
  int workLength=strideY + strideU + strideV;
  if (work.length < workLength)   throw new IllegalArgumentException("String_Node_Str" + workLength);
  ByteBuffer bufferY=planes[0].getBuffer();
  ByteBuffer bufferU=planes[2].getBuffer();
  ByteBuffer bufferV=planes[1].getBuffer();
  bufferY.position(0);
  bufferU.position(0);
  bufferV.position(0);
  int offsetU=strideY;
  int offsetV=strideY + strideU;
  int stridePixelUV=planes[1].getPixelStride();
  for (int y=0, indexOut=0; y < height; y++) {
    bufferY.get(work,0,strideY);
    if (y % stridePixelUV == 0) {
      bufferU.get(work,offsetU,Math.min(bufferU.remaining(),strideU));
      bufferV.get(work,offsetV,Math.min(bufferV.remaining(),strideV));
    }
    int indexY=0;
    int indexU=offsetU;
    int indexV=offsetV;
    for (int x=0; x < width; x++, indexY++) {
      output.data[indexOut++]=work[indexY];
      output.data[indexOut++]=work[indexU];
      output.data[indexOut++]=work[indexV];
      int stepUV=stridePixelUV * (((x + stridePixelUV - 1) % stridePixelUV) ^ 1);
      indexU+=stepUV;
      indexV+=stepUV;
    }
  }
  return output;
}