Program: 70891
Project: 70891
Buggy source:
private GL3Object buildObjectGLO(GL3 gl,RenderObject robj,int pidx,int nidx,int cidx,int tidx,int oidx,GL3Object pointObject,float pointRadius){
  GL3VertexAttributeArray[] pattribs=pointObject.getGL3VertexAttributes();
  int nattribs=pattribs.length;
  nattribs++;
  if (pidx >= 0) {
    nattribs++;
  }
  if (cidx >= 0) {
    nattribs++;
  }
  if (tidx >= 0) {
    tidx++;
  }
  GL3VertexAttributeArray[] attribs=new GL3VertexAttributeArray[nattribs];
  for (int i=0; i < pattribs.length; ++i) {
    attribs[i]=pattribs[i];
  }
  int aidx=pattribs.length;
  attribs[aidx++]=new GL3VertexAttributeArray(vbos[pointInfo.vboIndex],GL3VertexAttribute.INSTANCE_SCALE,GL.GL_FLOAT,1,false,pointInfo.offset,pointInfo.stride,pointInfo.count,robj.numPoints(oidx));
  if (pidx >= 0) {
    AttributeInfo pinfo=positionInfo[pidx];
    BufferObject vbo=vbos[pinfo.vboIndex];
    BufferStorage bs=positionPutter.storage();
    int offset=pinfo.offset + pointGroupOffsets[oidx] * pinfo.stride;
    attribs[aidx]=new GL3VertexAttributeArray(vbo,GL3VertexAttribute.INSTANCE_POSITION,GL3Util.getGLType(bs.type()),bs.size(),bs.isNormalized(),offset,pinfo.stride,pinfo.count,1);
    aidx++;
  }
  if (cidx >= 0) {
    AttributeInfo cinfo=colorInfo[cidx];
    BufferObject vbo=vbos[cinfo.vboIndex];
    BufferStorage bs=colorPutter.storage();
    int offset=cinfo.offset + pointGroupOffsets[oidx] * cinfo.stride;
    attribs[aidx]=new GL3VertexAttributeArray(vbo,GL3VertexAttribute.INSTANCE_COLOR,GL3Util.getGLType(bs.type()),bs.size(),bs.isNormalized(),offset,cinfo.stride,cinfo.count,1);
    aidx++;
  }
  if (tidx >= 0) {
    AttributeInfo tinfo=textureInfo[tidx];
    BufferObject vbo=vbos[tinfo.vboIndex];
    BufferStorage bs=texturePutter.storage();
    int offset=tinfo.offset + pointGroupOffsets[oidx] * tinfo.stride;
    attribs[aidx]=new GL3VertexAttributeArray(vbo,GL3VertexAttribute.INSTANCE_TEXTURE,GL3Util.getGLType(bs.type()),bs.size(),bs.isNormalized(),offset,tinfo.stride,tinfo.count,1);
    aidx++;
  }
  GL3Object glo=new GL3Object(gl,attribs,pointObject.getGL3ElementAttribute());
  glo.setDrawInfo(pointObject.getStart(),pointObject.getCount(),pointObject.getMode(),robj.numPoints(oidx));
  return glo;
}

Fixed version (ground truth):
private GL3Object buildObjectGLO(GL3 gl,RenderObject robj,int pidx,int nidx,int cidx,int tidx,int oidx,GL3Object pointObject,float pointRadius){
  GL3VertexAttributeArray[] pattribs=pointObject.getGL3VertexAttributes();
  int nattribs=pattribs.length;
  nattribs++;
  if (pidx >= 0) {
    nattribs++;
  }
  if (cidx >= 0) {
    nattribs++;
  }
  if (tidx >= 0) {
    tidx++;
  }
  GL3VertexAttributeArray[] attribs=new GL3VertexAttributeArray[nattribs];
  for (int i=0; i < pattribs.length; ++i) {
    attribs[i]=pattribs[i];
  }
  int aidx=pattribs.length;
  attribs[aidx++]=new GL3VertexAttributeArray(vbos[pointInfo.vboIndex],GL3VertexAttribute.INSTANCE_SCALE,GL.GL_FLOAT,1,false,pointInfo.offset,pointInfo.stride,pointInfo.count,robj.numPoints(oidx));
  int pointCount=pointGroupOffsets[oidx + 1] - pointGroupOffsets[oidx];
  if (pidx >= 0) {
    AttributeInfo pinfo=positionInfo[pidx];
    BufferObject vbo=vbos[pinfo.vboIndex];
    BufferStorage bs=positionPutter.storage();
    int offset=pinfo.offset + pointGroupOffsets[oidx] * pinfo.stride;
    attribs[aidx]=new GL3VertexAttributeArray(vbo,GL3VertexAttribute.INSTANCE_POSITION,GL3Util.getGLType(bs.type()),bs.size(),bs.isNormalized(),offset,pinfo.stride,pointCount,1);
    aidx++;
  }
  if (cidx >= 0) {
    AttributeInfo cinfo=colorInfo[cidx];
    BufferObject vbo=vbos[cinfo.vboIndex];
    BufferStorage bs=colorPutter.storage();
    int offset=cinfo.offset + pointGroupOffsets[oidx] * cinfo.stride;
    attribs[aidx]=new GL3VertexAttributeArray(vbo,GL3VertexAttribute.INSTANCE_COLOR,GL3Util.getGLType(bs.type()),bs.size(),bs.isNormalized(),offset,cinfo.stride,pointCount,1);
    aidx++;
  }
  if (tidx >= 0) {
    AttributeInfo tinfo=textureInfo[tidx];
    BufferObject vbo=vbos[tinfo.vboIndex];
    BufferStorage bs=texturePutter.storage();
    int offset=tinfo.offset + pointGroupOffsets[oidx] * tinfo.stride;
    attribs[aidx]=new GL3VertexAttributeArray(vbo,GL3VertexAttribute.INSTANCE_TEXTURE,GL3Util.getGLType(bs.type()),bs.size(),bs.isNormalized(),offset,tinfo.stride,pointCount,1);
    aidx++;
  }
  GL3Object glo=new GL3Object(gl,attribs,pointObject.getGL3ElementAttribute());
  glo.setDrawInfo(pointObject.getStart(),pointObject.getCount(),pointObject.getMode(),robj.numPoints(oidx));
  return glo;
}