Program: 61731
Project: 61731
Buggy source:
/** 
 * Construct SWF from stream
 * @param is Stream to read SWF from
 * @param listener
 * @param parallelRead Use parallel threads?
 * @param checkOnly Check only file validity
 * @throws IOException
 * @throws java.lang.InterruptedException
 */
public SWF(InputStream is,ProgressListener listener,boolean parallelRead,boolean checkOnly) throws IOException, InterruptedException {
  byte[] hdr=new byte[3];
  is.read(hdr);
  String shdr=new String(hdr,Utf8Helper.charset);
  if (!Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str").contains(shdr)) {
    throw new IOException("String_Node_Str");
  }
  version=is.read();
  SWFInputStream sis=new SWFInputStream(is,version,4);
  fileSize=sis.readUI32();
  if (hdr[1] == 'F' && hdr[2] == 'X') {
    gfx=true;
  }
  if (hdr[0] == 'C') {
    byte[] uncompressedData=Helper.readStream(new InflaterInputStream(is));
    sis=new SWFInputStream(new ByteArrayInputStream(uncompressedData),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");
    }
    long dictionarySize=0;
    for (int i=0; i < 4; i++) {
      dictionarySize+=((int)(lzmaProperties[1 + i]) & 0xFF) << (i * 8);
      if (dictionarySize > Runtime.getRuntime().freeMemory()) {
        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();
  List<Tag> tags=sis.readTagList(this,this,0,parallelRead,true,!checkOnly,gfx);
  if (tags.get(tags.size() - 1).getId() == EndTag.ID) {
    hasEndTag=true;
    tags.remove(tags.size() - 1);
  }
  this.tags=tags;
  if (!checkOnly) {
    checkInvalidSprites();
    updateInnerTagsForShowFrameTags();
    updateCharacters();
    assignExportNamesToSymbols();
    assignClassesToSymbols();
    findFileAttributes();
  }
 else {
    boolean hasNonUnknownTag=false;
    for (    Tag tag : tags) {
      if (tag.getOriginalData().length > 0 && Tag.getRequiredTags().contains(tag.getId())) {
        hasNonUnknownTag=true;
      }
    }
    if (!hasNonUnknownTag) {
      throw new IOException("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Construct SWF from stream
 * @param is Stream to read SWF from
 * @param listener
 * @param parallelRead Use parallel threads?
 * @param checkOnly Check only file validity
 * @throws IOException
 * @throws java.lang.InterruptedException
 */
public SWF(InputStream is,ProgressListener listener,boolean parallelRead,boolean checkOnly) throws IOException, InterruptedException {
  byte[] hdr=new byte[3];
  is.read(hdr);
  String shdr=new String(hdr,Utf8Helper.charset);
  if (!Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str").contains(shdr)) {
    throw new IOException("String_Node_Str");
  }
  version=is.read();
  SWFInputStream sis=new SWFInputStream(is,version,4);
  fileSize=sis.readUI32();
  if (hdr[1] == 'F' && hdr[2] == 'X') {
    gfx=true;
  }
  if (hdr[0] == 'C') {
    byte[] uncompressedData=Helper.readStream(new InflaterInputStream(is));
    sis=new SWFInputStream(new ByteArrayInputStream(uncompressedData),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");
    }
    long dictionarySize=0;
    for (int i=0; i < 4; i++) {
      dictionarySize+=((int)(lzmaProperties[1 + i]) & 0xFF) << (i * 8);
      if (dictionarySize > Runtime.getRuntime().freeMemory()) {
        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();
  List<Tag> tags=sis.readTagList(this,this,0,parallelRead,true,!checkOnly,gfx);
  if (tags.get(tags.size() - 1).getId() == EndTag.ID) {
    hasEndTag=true;
    tags.remove(tags.size() - 1);
  }
  this.tags=tags;
  if (!checkOnly) {
    checkInvalidSprites();
    updateInnerTagsForShowFrameTags();
    updateCharacters();
    assignExportNamesToSymbols();
    assignClassesToSymbols();
    findFileAttributes();
    findABCTags();
  }
 else {
    boolean hasNonUnknownTag=false;
    for (    Tag tag : tags) {
      if (tag.getOriginalData().length > 0 && Tag.getRequiredTags().contains(tag.getId())) {
        hasNonUnknownTag=true;
      }
    }
    if (!hasNonUnknownTag) {
      throw new IOException("String_Node_Str");
    }
  }
}