Program: 109309
Project: 109309
Buggy source:
protected void allocate(){
  if (!matricesAllocated) {
    projection=new float[16];
    modelview=new float[16];
    modelviewInv=new float[16];
    camera=new float[16];
    cameraInv=new float[16];
    matricesAllocated=true;
  }
  if (!lightsAllocated) {
    lightType=new int[MAX_LIGHTS];
    lightPosition=new float[MAX_LIGHTS][4];
    lightNormal=new float[MAX_LIGHTS][4];
    lightDiffuse=new float[MAX_LIGHTS][4];
    lightSpecular=new float[MAX_LIGHTS][4];
    lightFalloffConstant=new float[MAX_LIGHTS];
    lightFalloffLinear=new float[MAX_LIGHTS];
    lightFalloffQuadratic=new float[MAX_LIGHTS];
    lightSpotAngle=new float[MAX_LIGHTS];
    lightSpotAngleCos=new float[MAX_LIGHTS];
    lightSpotConcentration=new float[MAX_LIGHTS];
    currentLightSpecular=new float[4];
    lightsAllocated=true;
  }
  if (!buffersAllocated) {
    ByteBuffer vbb=ByteBuffer.allocateDirect(DEFAULT_BUFFER_SIZE * 3 * SIZEOF_INT);
    vbb.order(ByteOrder.nativeOrder());
    vertexBuffer=vbb.asIntBuffer();
    ByteBuffer cbb=ByteBuffer.allocateDirect(DEFAULT_BUFFER_SIZE * 4 * SIZEOF_INT);
    cbb.order(ByteOrder.nativeOrder());
    colorBuffer=cbb.asIntBuffer();
    ByteBuffer tbb=ByteBuffer.allocateDirect(DEFAULT_BUFFER_SIZE * 2 * SIZEOF_INT);
    tbb.order(ByteOrder.nativeOrder());
    texCoordBuffer=tbb.asIntBuffer();
    ByteBuffer nbb=ByteBuffer.allocateDirect(DEFAULT_BUFFER_SIZE * 3 * SIZEOF_INT);
    nbb.order(ByteOrder.nativeOrder());
    normalBuffer=nbb.asIntBuffer();
    buffersAllocated=true;
  }
  if (!screenTexAllocated) {
    screenNVertices=6;
    ByteBuffer vbb=ByteBuffer.allocateDirect(screenNVertices * 3 * SIZEOF_INT);
    vbb.order(ByteOrder.nativeOrder());
    screenVertBuffer=vbb.asIntBuffer();
    ByteBuffer tbb=ByteBuffer.allocateDirect(screenNVertices * 2 * SIZEOF_INT);
    tbb.order(ByteOrder.nativeOrder());
    screenTexCoordBuffer=tbb.asIntBuffer();
    screenTexAllocated=true;
  }
}

Fixed version (ground truth):
protected void allocate(){
  if (!matricesAllocated) {
    projection=new float[16];
    modelview=new float[16];
    modelviewInv=new float[16];
    camera=new float[16];
    cameraInv=new float[16];
    matricesAllocated=true;
  }
  if (!lightsAllocated) {
    lightType=new int[MAX_LIGHTS];
    lightPosition=new float[MAX_LIGHTS][4];
    lightNormal=new float[MAX_LIGHTS][4];
    lightDiffuse=new float[MAX_LIGHTS][4];
    lightSpecular=new float[MAX_LIGHTS][4];
    lightFalloffConstant=new float[MAX_LIGHTS];
    lightFalloffLinear=new float[MAX_LIGHTS];
    lightFalloffQuadratic=new float[MAX_LIGHTS];
    lightSpotAngle=new float[MAX_LIGHTS];
    lightSpotAngleCos=new float[MAX_LIGHTS];
    lightSpotConcentration=new float[MAX_LIGHTS];
    currentLightSpecular=new float[4];
    lightsAllocated=true;
  }
  if (!buffersAllocated) {
    ByteBuffer vbb=ByteBuffer.allocateDirect(DEFAULT_BUFFER_SIZE * 3 * SIZEOF_INT);
    vbb.order(ByteOrder.nativeOrder());
    vertexBuffer=vbb.asIntBuffer();
    ByteBuffer cbb=ByteBuffer.allocateDirect(DEFAULT_BUFFER_SIZE * 4 * SIZEOF_INT);
    cbb.order(ByteOrder.nativeOrder());
    colorBuffer=cbb.asIntBuffer();
    ByteBuffer tbb=ByteBuffer.allocateDirect(DEFAULT_BUFFER_SIZE * 2 * SIZEOF_INT);
    tbb.order(ByteOrder.nativeOrder());
    texCoordBuffer=tbb.asIntBuffer();
    ByteBuffer nbb=ByteBuffer.allocateDirect(DEFAULT_BUFFER_SIZE * 3 * SIZEOF_INT);
    nbb.order(ByteOrder.nativeOrder());
    normalBuffer=nbb.asIntBuffer();
    buffersAllocated=true;
  }
}