Program: 110467
Project: 110467
Buggy source:
ClosedCaptionList parse(SampleHolder sampleHolder){
  if (sampleHolder.size <= 0) {
    return null;
  }
  captions.clear();
  stringBuilder.setLength(0);
  seiBuffer.reset(sampleHolder.data.array());
  seiBuffer.skipBits(3);
  int ccCount=seiBuffer.readBits(5);
  seiBuffer.skipBits(8);
  for (int i=0; i < ccCount; i++) {
    seiBuffer.skipBits(5);
    boolean ccValid=seiBuffer.readBit();
    if (!ccValid) {
      seiBuffer.skipBits(18);
      continue;
    }
    int ccType=seiBuffer.readBits(2);
    if (ccType != 0) {
      seiBuffer.skipBits(16);
      continue;
    }
    seiBuffer.skipBits(1);
    byte ccData1=(byte)seiBuffer.readBits(7);
    seiBuffer.skipBits(1);
    byte ccData2=(byte)seiBuffer.readBits(7);
    if (ccData1 == 0 && ccData2 == 0) {
      continue;
    }
    if ((ccData1 == 0x11) && ((ccData2 & 0x70) == 0x30)) {
      stringBuilder.append(getSpecialChar(ccData2));
      continue;
    }
    if (ccData1 < 0x20) {
      if (stringBuilder.length() > 0) {
        captions.add(new ClosedCaptionText(stringBuilder.toString()));
        stringBuilder.setLength(0);
      }
      captions.add(new ClosedCaptionCtrl(ccData1,ccData2));
      continue;
    }
    stringBuilder.append(getChar(ccData1));
    if (ccData2 != 0) {
      stringBuilder.append(getChar(ccData2));
    }
  }
  if (stringBuilder.length() > 0) {
    captions.add(new ClosedCaptionText(stringBuilder.toString()));
  }
  if (captions.isEmpty()) {
    return null;
  }
  ClosedCaption[] captionArray=new ClosedCaption[captions.size()];
  captions.toArray(captionArray);
  return new ClosedCaptionList(sampleHolder.timeUs,sampleHolder.decodeOnly,captionArray);
}

Fixed version (ground truth):
ClosedCaptionList parse(SampleHolder sampleHolder){
  if (sampleHolder.size < 10) {
    return null;
  }
  captions.clear();
  stringBuilder.setLength(0);
  seiBuffer.reset(sampleHolder.data.array());
  seiBuffer.skipBits(67);
  int ccCount=seiBuffer.readBits(5);
  seiBuffer.skipBits(8);
  for (int i=0; i < ccCount; i++) {
    seiBuffer.skipBits(5);
    boolean ccValid=seiBuffer.readBit();
    if (!ccValid) {
      seiBuffer.skipBits(18);
      continue;
    }
    int ccType=seiBuffer.readBits(2);
    if (ccType != 0) {
      seiBuffer.skipBits(16);
      continue;
    }
    seiBuffer.skipBits(1);
    byte ccData1=(byte)seiBuffer.readBits(7);
    seiBuffer.skipBits(1);
    byte ccData2=(byte)seiBuffer.readBits(7);
    if (ccData1 == 0 && ccData2 == 0) {
      continue;
    }
    if ((ccData1 == 0x11) && ((ccData2 & 0x70) == 0x30)) {
      stringBuilder.append(getSpecialChar(ccData2));
      continue;
    }
    if (ccData1 < 0x20) {
      if (stringBuilder.length() > 0) {
        captions.add(new ClosedCaptionText(stringBuilder.toString()));
        stringBuilder.setLength(0);
      }
      captions.add(new ClosedCaptionCtrl(ccData1,ccData2));
      continue;
    }
    stringBuilder.append(getChar(ccData1));
    if (ccData2 != 0) {
      stringBuilder.append(getChar(ccData2));
    }
  }
  if (stringBuilder.length() > 0) {
    captions.add(new ClosedCaptionText(stringBuilder.toString()));
  }
  if (captions.isEmpty()) {
    return null;
  }
  ClosedCaption[] captionArray=new ClosedCaption[captions.size()];
  captions.toArray(captionArray);
  return new ClosedCaptionList(sampleHolder.timeUs,sampleHolder.decodeOnly,captionArray);
}