Program: 62144
Project: 62144
Buggy source:
/** 
 * Construct SWF from stream
 * @param is Stream to read SWF from
 * @throws IOException
 */
public SWF(InputStream is,PercentListener listener,boolean paralelRead) throws IOException {
  byte hdr[]=new byte[3];
  is.read(hdr);
  String shdr=new String(hdr,"String_Node_Str");
  if ((!shdr.equals("String_Node_Str")) && (!shdr.equals("String_Node_Str")) && (!shdr.equals("String_Node_Str"))) {
    throw new IOException("String_Node_Str");
  }
  version=is.read();
  SWFInputStream sis=new SWFInputStream(is,version,4);
  fileSize=sis.readUI32();
  if (hdr[0] == 'C') {
    sis=new SWFInputStream(new InflaterInputStream(is),version,8);
    compressed=true;
  }
  if (hdr[0] == 'Z') {
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    sis.readUI32();
    int propertiesSize=5;
    lzmaProperties=new byte[propertiesSize];
    if (sis.read(lzmaProperties,0,propertiesSize) != propertiesSize) {
      throw new IOException("String_Node_Str");
    }
    SevenZip.Compression.LZMA.Decoder decoder=new SevenZip.Compression.LZMA.Decoder();
    if (!decoder.SetDecoderProperties(lzmaProperties)) {
      throw new IOException("String_Node_Str");
    }
    if (!decoder.Code(sis,baos,fileSize - 8)) {
      throw new IOException("String_Node_Str");
    }
    sis=new SWFInputStream(new ByteArrayInputStream(baos.toByteArray()),version,8);
    compressed=true;
    lzma=true;
  }
  if (listener != null) {
    sis.addPercentListener(listener);
  }
  sis.setPercentMax(fileSize);
  displayRect=sis.readRECT();
  sis.readUI8();
  frameRate=sis.readUI8();
  frameCount=sis.readUI16();
  tags=sis.readTagList(0,paralelRead);
  assignExportNamesToSymbols();
  assignClassesToSymbols();
  for (  Tag t : tags) {
    if (t instanceof FileAttributesTag) {
      fileAttributes=(FileAttributesTag)t;
      break;
    }
  }
}

Fixed version (ground truth):
/** 
 * Construct SWF from stream
 * @param is Stream to read SWF from
 * @param listener 
 * @param paralelRead Use parallel threads?
 * @throws IOException
 */
public SWF(InputStream is,PercentListener listener,boolean paralelRead) throws IOException {
  byte hdr[]=new byte[3];
  is.read(hdr);
  String shdr=new String(hdr,"String_Node_Str");
  if ((!shdr.equals("String_Node_Str")) && (!shdr.equals("String_Node_Str")) && (!shdr.equals("String_Node_Str"))) {
    throw new IOException("String_Node_Str");
  }
  version=is.read();
  SWFInputStream sis=new SWFInputStream(is,version,4);
  fileSize=sis.readUI32();
  if (hdr[0] == 'C') {
    sis=new SWFInputStream(new InflaterInputStream(is),version,8);
    compressed=true;
  }
  if (hdr[0] == 'Z') {
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    sis.readUI32();
    int propertiesSize=5;
    lzmaProperties=new byte[propertiesSize];
    if (sis.read(lzmaProperties,0,propertiesSize) != propertiesSize) {
      throw new IOException("String_Node_Str");
    }
    SevenZip.Compression.LZMA.Decoder decoder=new SevenZip.Compression.LZMA.Decoder();
    if (!decoder.SetDecoderProperties(lzmaProperties)) {
      throw new IOException("String_Node_Str");
    }
    if (!decoder.Code(sis,baos,fileSize - 8)) {
      throw new IOException("String_Node_Str");
    }
    sis=new SWFInputStream(new ByteArrayInputStream(baos.toByteArray()),version,8);
    compressed=true;
    lzma=true;
  }
  if (listener != null) {
    sis.addPercentListener(listener);
  }
  sis.setPercentMax(fileSize);
  displayRect=sis.readRECT();
  sis.readUI8();
  frameRate=sis.readUI8();
  frameCount=sis.readUI16();
  tags=sis.readTagList(0,paralelRead);
  assignExportNamesToSymbols();
  assignClassesToSymbols();
  for (  Tag t : tags) {
    if (t instanceof FileAttributesTag) {
      fileAttributes=(FileAttributesTag)t;
      break;
    }
  }
}