Program: 62170
Project: 62170
Buggy source:
/** 
 * Gets data bytes
 * @param version SWF version
 * @return Bytes of data
 */
@Override public byte[] getData(int version){
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  OutputStream os=baos;
  SWFOutputStream sos=new SWFOutputStream(os,version);
  if (Configuration.DEBUG_COPY) {
    sos=new SWFOutputStream(new CopyOutputStream(sos,new ByteArrayInputStream(data)),10);
  }
  try {
    sos.writeUI16(fontId);
    sos.writeUB(1,fontFlagsHasLayout ? 1 : 0);
    sos.writeUB(1,fontFlagsShiftJIS ? 1 : 0);
    sos.writeUB(1,fontFlagsSmallText ? 1 : 0);
    sos.writeUB(1,fontFlagsANSI ? 1 : 0);
    sos.writeUB(1,fontFlagsWideOffsets ? 1 : 0);
    sos.writeUB(1,fontFlagsWideCodes ? 1 : 0);
    sos.writeUB(1,fontFlagsItalic ? 1 : 0);
    sos.writeUB(1,fontFlagsBold ? 1 : 0);
    sos.writeLANGCODE(languageCode);
    sos.writeUI8(fontName.getBytes().length);
    sos.write(fontName.getBytes());
    sos.writeUI16(numGlyphs);
    ByteArrayOutputStream baos2=new ByteArrayOutputStream();
    SWFOutputStream sos2=new SWFOutputStream(baos2,version);
    for (int i=0; i < numGlyphs; i++) {
      if (fontFlagsWideOffsets) {
        sos2.writeUI32(offsetTable[i]);
      }
 else {
        sos2.writeUI16((int)offsetTable[i]);
      }
    }
    byte ba2[]=baos2.toByteArray();
    ByteArrayOutputStream baos3=new ByteArrayOutputStream();
    SWFOutputStream sos3=new SWFOutputStream(baos3,version);
    for (int i=0; i < numGlyphs; i++) {
      sos3.writeSHAPE(glyphShapeTable[i],1);
    }
    byte ba3[]=baos3.toByteArray();
    sos.write(ba2);
    if (numGlyphs > 0) {
      if (fontFlagsWideOffsets) {
        long offset=ba2.length + ba3.length + 4;
        sos.writeUI32(offset);
      }
 else {
        long offset=ba2.length + ba3.length + 2;
        sos.writeUI16((int)offset);
      }
      sos.write(ba3);
      for (int i=0; i < numGlyphs; i++) {
        if (fontFlagsWideCodes) {
          sos.writeUI16(codeTable.get(i));
        }
 else {
          sos.writeUI8(codeTable.get(i));
        }
      }
    }
    if (fontFlagsHasLayout) {
      sos.writeSI16(fontAscent);
      sos.writeSI16(fontDescent);
      sos.writeSI16(fontLeading);
      for (int i=0; i < numGlyphs; i++) {
        sos.writeSI16(fontAdvanceTable[i]);
      }
      for (int i=0; i < numGlyphs; i++) {
        sos.writeRECT(fontBoundsTable[i]);
      }
      sos.writeUI16(fontKerningTable.length);
      for (int k=0; k < fontKerningTable.length; k++) {
        sos.writeKERNINGRECORD(fontKerningTable[k],fontFlagsWideCodes);
      }
    }
  }
 catch (  IOException e) {
  }
  return baos.toByteArray();
}

Fixed version (ground truth):
/** 
 * Gets data bytes
 * @param version SWF version
 * @return Bytes of data
 */
@Override public byte[] getData(int version){
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  OutputStream os=baos;
  SWFOutputStream sos=new SWFOutputStream(os,version);
  if (Configuration.DEBUG_COPY) {
    sos=new SWFOutputStream(new CopyOutputStream(sos,new ByteArrayInputStream(data)),10);
  }
  try {
    sos.writeUI16(fontId);
    sos.writeUB(1,fontFlagsHasLayout ? 1 : 0);
    sos.writeUB(1,fontFlagsShiftJIS ? 1 : 0);
    sos.writeUB(1,fontFlagsSmallText ? 1 : 0);
    sos.writeUB(1,fontFlagsANSI ? 1 : 0);
    sos.writeUB(1,fontFlagsWideOffsets ? 1 : 0);
    sos.writeUB(1,fontFlagsWideCodes ? 1 : 0);
    sos.writeUB(1,fontFlagsItalic ? 1 : 0);
    sos.writeUB(1,fontFlagsBold ? 1 : 0);
    sos.writeLANGCODE(languageCode);
    sos.writeUI8(fontName.getBytes("String_Node_Str").length);
    sos.write(fontName.getBytes("String_Node_Str"));
    sos.writeUI16(numGlyphs);
    ByteArrayOutputStream baos2=new ByteArrayOutputStream();
    SWFOutputStream sos2=new SWFOutputStream(baos2,version);
    for (int i=0; i < numGlyphs; i++) {
      if (fontFlagsWideOffsets) {
        sos2.writeUI32(offsetTable[i]);
      }
 else {
        sos2.writeUI16((int)offsetTable[i]);
      }
    }
    byte ba2[]=baos2.toByteArray();
    ByteArrayOutputStream baos3=new ByteArrayOutputStream();
    SWFOutputStream sos3=new SWFOutputStream(baos3,version);
    for (int i=0; i < numGlyphs; i++) {
      sos3.writeSHAPE(glyphShapeTable[i],1);
    }
    byte ba3[]=baos3.toByteArray();
    sos.write(ba2);
    if (numGlyphs > 0) {
      if (fontFlagsWideOffsets) {
        long offset=ba2.length + ba3.length + 4;
        sos.writeUI32(offset);
      }
 else {
        long offset=ba2.length + ba3.length + 2;
        sos.writeUI16((int)offset);
      }
      sos.write(ba3);
      for (int i=0; i < numGlyphs; i++) {
        if (fontFlagsWideCodes) {
          sos.writeUI16(codeTable.get(i));
        }
 else {
          sos.writeUI8(codeTable.get(i));
        }
      }
    }
    if (fontFlagsHasLayout) {
      sos.writeSI16(fontAscent);
      sos.writeSI16(fontDescent);
      sos.writeSI16(fontLeading);
      for (int i=0; i < numGlyphs; i++) {
        sos.writeSI16(fontAdvanceTable[i]);
      }
      for (int i=0; i < numGlyphs; i++) {
        sos.writeRECT(fontBoundsTable[i]);
      }
      sos.writeUI16(fontKerningTable.length);
      for (int k=0; k < fontKerningTable.length; k++) {
        sos.writeKERNINGRECORD(fontKerningTable[k],fontFlagsWideCodes);
      }
    }
  }
 catch (  IOException e) {
  }
  return baos.toByteArray();
}