Program: 110181
Project: 110181
Buggy source:
private static CodeBook readBook(VorbisBitArray bitArray) throws ParserException {
  if (bitArray.readBits(24) != 0x564342) {
    throw new ParserException("String_Node_Str" + bitArray.getPosition());
  }
  int dimensions=bitArray.readBits(16);
  int entries=bitArray.readBits(24);
  long[] lengthMap=new long[entries];
  boolean isOrdered=bitArray.readBit();
  if (!isOrdered) {
    boolean isSparse=bitArray.readBit();
    for (int i=0; i < lengthMap.length; i++) {
      if (isSparse) {
        if (bitArray.readBit()) {
          lengthMap[i]=bitArray.readBits(5) + 1;
        }
 else {
          lengthMap[i]=0;
        }
      }
 else {
        lengthMap[i]=bitArray.readBits(5) + 1;
      }
    }
  }
 else {
    int length=bitArray.readBits(5) + 1;
    for (int i=0; i < lengthMap.length; ) {
      int num=bitArray.readBits(iLog(entries - i));
      for (int j=0; j < num && i < lengthMap.length; i++, j++) {
        lengthMap[i]=length;
      }
      length++;
    }
  }
  int lookupType=bitArray.readBits(4);
  if (lookupType > 2) {
    throw new ParserException("String_Node_Str" + lookupType);
  }
 else   if (lookupType == 1 || lookupType == 2) {
    bitArray.skipBits(32);
    bitArray.skipBits(32);
    int valueBits=bitArray.readBits(4) + 1;
    bitArray.skipBits(1);
    long lookupValuesCount;
    if (lookupType == 1) {
      if (dimensions != 0) {
        lookupValuesCount=mapType1QuantValues(entries,dimensions);
      }
 else {
        lookupValuesCount=0;
      }
    }
 else {
      lookupValuesCount=entries * dimensions;
    }
    bitArray.skipBits((int)(lookupValuesCount * valueBits));
  }
  return new CodeBook(dimensions,entries,lengthMap,lookupType,isOrdered);
}

Fixed version (ground truth):
private static CodeBook readBook(VorbisBitArray bitArray) throws ParserException {
  if (bitArray.readBits(24) != 0x564342) {
    throw new ParserException("String_Node_Str" + bitArray.getPosition());
  }
  int dimensions=bitArray.readBits(16);
  int entries=bitArray.readBits(24);
  long[] lengthMap=new long[entries];
  boolean isOrdered=bitArray.readBit();
  if (!isOrdered) {
    boolean isSparse=bitArray.readBit();
    for (int i=0; i < lengthMap.length; i++) {
      if (isSparse) {
        if (bitArray.readBit()) {
          lengthMap[i]=(long)(bitArray.readBits(5) + 1);
        }
 else {
          lengthMap[i]=0;
        }
      }
 else {
        lengthMap[i]=(long)(bitArray.readBits(5) + 1);
      }
    }
  }
 else {
    int length=bitArray.readBits(5) + 1;
    for (int i=0; i < lengthMap.length; ) {
      int num=bitArray.readBits(iLog(entries - i));
      for (int j=0; j < num && i < lengthMap.length; i++, j++) {
        lengthMap[i]=length;
      }
      length++;
    }
  }
  int lookupType=bitArray.readBits(4);
  if (lookupType > 2) {
    throw new ParserException("String_Node_Str" + lookupType);
  }
 else   if (lookupType == 1 || lookupType == 2) {
    bitArray.skipBits(32);
    bitArray.skipBits(32);
    int valueBits=bitArray.readBits(4) + 1;
    bitArray.skipBits(1);
    long lookupValuesCount;
    if (lookupType == 1) {
      if (dimensions != 0) {
        lookupValuesCount=mapType1QuantValues(entries,dimensions);
      }
 else {
        lookupValuesCount=0;
      }
    }
 else {
      lookupValuesCount=(long)entries * dimensions;
    }
    bitArray.skipBits((int)(lookupValuesCount * valueBits));
  }
  return new CodeBook(dimensions,entries,lengthMap,lookupType,isOrdered);
}