Program: 150591
Project: 150591
Buggy source:
public static Planar<GrayU8> yuvToPlanarYuvU8(Image yuv,Planar<GrayU8> output,byte work[]){
  int width=yuv.getWidth();
  int height=yuv.getHeight();
  if (output != null) {
    output.setNumberOfBands(3);
    output.reshape(width,height);
  }
 else {
    output=new Planar(GrayU8.class,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();
  GrayU8 bandY=output.getBand(0);
  GrayU8 bandU=output.getBand(1);
  GrayU8 bandV=output.getBand(2);
  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++, indexOut++) {
      bandY.data[indexOut]=work[indexY];
      bandU.data[indexOut]=work[indexU];
      bandV.data[indexOut]=work[indexV];
      int stepUV=stridePixelUV * (((x + stridePixelUV - 1) % stridePixelUV) ^ 1);
      indexU+=stepUV;
      indexV+=stepUV;
    }
  }
  return output;
}

Fixed version (ground truth):
public static Planar<GrayU8> yuvToPlanarYuvU8(Image yuv,Planar<GrayU8> output,byte work[]){
  int width=yuv.getWidth();
  int height=yuv.getHeight();
  if (output != null) {
    output.setNumberOfBands(3);
    output.reshape(width,height);
  }
 else {
    output=new Planar(GrayU8.class,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();
  GrayU8 bandY=output.getBand(0);
  GrayU8 bandU=output.getBand(1);
  GrayU8 bandV=output.getBand(2);
  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++, indexOut++) {
      bandY.data[indexOut]=work[indexY];
      bandU.data[indexOut]=work[indexU];
      bandV.data[indexOut]=work[indexV];
      int stepUV=stridePixelUV * (((x + stridePixelUV - 1) % stridePixelUV) ^ 1);
      indexU+=stepUV;
      indexV+=stepUV;
    }
  }
  return output;
}