Program: 61814
Project: 61814
Buggy source:
/** 
 * Reads list of tags from the stream. Reading ends with End tag(=0) or end of the stream. Optionally can skip AS1/2 tags when file is AS3
 * @param swf
 * @param level
 * @param parallel
 * @param skipUnusualTags
 * @param parseTags
 * @param gfx
 * @return List of tags
 * @throws IOException
 * @throws java.lang.InterruptedException
 */
public List<Tag> readTagList(SWF swf,int level,boolean parallel,boolean skipUnusualTags,boolean parseTags,boolean gfx) throws IOException, InterruptedException {
  ExecutorService executor=null;
  List<Future<Tag>> futureResults=new ArrayList<>();
  if (parallel) {
    executor=Executors.newFixedThreadPool(Configuration.parallelThreadCount.get());
    futureResults=new ArrayList<>();
  }
  List<Tag> tags=new ArrayList<>();
  Tag tag;
  Tag previousTag=null;
  boolean isAS3=false;
  while (true) {
    long pos=getPos();
    try {
      tag=readTag(swf,level,pos,parseTags && !parallel,parallel,skipUnusualTags,gfx);
    }
 catch (    EOFException|EndOfStreamException ex) {
      tag=null;
    }
    if (tag == null) {
      break;
    }
    if (!parallel) {
      tags.add(tag);
    }
    if (Configuration.dumpTags.get() && level == 0) {
      dumpTag(System.out,version,tag,level);
    }
    tag.previousTag=previousTag;
    previousTag=tag;
    if (ShowFrameTag.isNestedTagType(tag.getId())) {
      tagPositionsInFrame.add(pos);
    }
 else     if (tag.getId() == ShowFrameTag.ID) {
      tagPositionsInFrames.put(pos,tagPositionsInFrame);
      tagPositionsInFrame=new ArrayList<>();
    }
    boolean doParse;
    if (!skipUnusualTags) {
      doParse=true;
    }
 else {
switch (tag.getId()) {
case FileAttributesTag.ID:
        FileAttributesTag fileAttributes=(FileAttributesTag)resolveTag(swf,tag,version,level,parallel,skipUnusualTags,gfx);
      if (fileAttributes.actionScript3) {
        isAS3=true;
      }
    doParse=true;
  break;
case DoActionTag.ID:
case DoInitActionTag.ID:
if (isAS3) {
  doParse=false;
}
 else {
  doParse=true;
}
break;
case ShowFrameTag.ID:
case PlaceObjectTag.ID:
case PlaceObject2Tag.ID:
case RemoveObjectTag.ID:
case RemoveObject2Tag.ID:
case PlaceObject3Tag.ID:
case StartSoundTag.ID:
case FrameLabelTag.ID:
case SoundStreamHeadTag.ID:
case SoundStreamHead2Tag.ID:
case SoundStreamBlockTag.ID:
doParse=true;
break;
default :
if (level > 0) {
Logger.getLogger(SWFInputStream.class.getName()).log(Level.FINE,"String_Node_Str",tag.getId());
doParse=false;
}
 else {
doParse=true;
}
}
}
if (!parseTags) {
doParse=false;
}
if (doParse) {
if (parallel) {
Future<Tag> future=executor.submit(new TagResolutionTask(swf,tag,version,level,parallel,skipUnusualTags,gfx));
futureResults.add(future);
}
}
}
if (parallel) {
for (Future<Tag> future : futureResults) {
try {
tags.add(future.get());
}
 catch (InterruptedException ex) {
future.cancel(true);
}
catch (ExecutionException e) {
Logger.getLogger(SWFInputStream.class.getName()).log(Level.SEVERE,"String_Node_Str",e);
}
}
executor.shutdown();
}
return tags;
}

Fixed version (ground truth):
/** 
 * Reads list of tags from the stream. Reading ends with End tag(=0) or end of the stream. Optionally can skip AS1/2 tags when file is AS3
 * @param swf
 * @param level
 * @param parallel
 * @param skipUnusualTags
 * @param parseTags
 * @param gfx
 * @return List of tags
 * @throws IOException
 * @throws java.lang.InterruptedException
 */
public List<Tag> readTagList(SWF swf,int level,boolean parallel,boolean skipUnusualTags,boolean parseTags,boolean gfx) throws IOException, InterruptedException {
  ExecutorService executor=null;
  List<Future<Tag>> futureResults=new ArrayList<>();
  if (parallel) {
    executor=Executors.newFixedThreadPool(Configuration.parallelThreadCount.get());
    futureResults=new ArrayList<>();
  }
  List<Tag> tags=new ArrayList<>();
  Tag tag;
  Tag previousTag=null;
  boolean isAS3=false;
  while (true) {
    long pos=getPos();
    try {
      tag=readTag(swf,level,pos,parseTags && !parallel,parallel,skipUnusualTags,gfx);
    }
 catch (    EOFException|EndOfStreamException ex) {
      tag=null;
    }
    if (tag == null) {
      break;
    }
    if (!parallel) {
      tags.add(tag);
    }
    if (Configuration.dumpTags.get() && level == 0) {
      dumpTag(System.out,version,tag,level);
    }
    tag.previousTag=previousTag;
    previousTag=tag;
    if (ShowFrameTag.isNestedTagType(tag.getId())) {
      tagPositionsInFrame.add(pos);
    }
 else     if (tag.getId() == ShowFrameTag.ID) {
      tagPositionsInFrames.put(pos,tagPositionsInFrame);
      tagPositionsInFrame=new ArrayList<>();
    }
    boolean doParse;
    if (!skipUnusualTags) {
      doParse=true;
    }
 else {
switch (tag.getId()) {
case FileAttributesTag.ID:
        FileAttributesTag fileAttributes=(FileAttributesTag)resolveTag(swf,tag,version,level,parallel,skipUnusualTags,gfx);
      if (fileAttributes.actionScript3) {
        isAS3=true;
      }
    doParse=true;
  break;
case DoActionTag.ID:
case DoInitActionTag.ID:
if (isAS3) {
  doParse=false;
}
 else {
  doParse=true;
}
break;
case ShowFrameTag.ID:
case PlaceObjectTag.ID:
case PlaceObject2Tag.ID:
case RemoveObjectTag.ID:
case RemoveObject2Tag.ID:
case PlaceObject3Tag.ID:
case StartSoundTag.ID:
case FrameLabelTag.ID:
case SoundStreamHeadTag.ID:
case SoundStreamHead2Tag.ID:
case SoundStreamBlockTag.ID:
case VideoFrameTag.ID:
doParse=true;
break;
default :
if (level > 0) {
Logger.getLogger(SWFInputStream.class.getName()).log(Level.FINE,"String_Node_Str",tag.getId());
doParse=false;
}
 else {
doParse=true;
}
}
}
if (!parseTags) {
doParse=false;
}
if (doParse) {
if (parallel) {
Future<Tag> future=executor.submit(new TagResolutionTask(swf,tag,version,level,parallel,skipUnusualTags,gfx));
futureResults.add(future);
}
}
}
if (parallel) {
for (Future<Tag> future : futureResults) {
try {
tags.add(future.get());
}
 catch (InterruptedException ex) {
future.cancel(true);
}
catch (ExecutionException e) {
Logger.getLogger(SWFInputStream.class.getName()).log(Level.SEVERE,"String_Node_Str",e);
}
}
executor.shutdown();
}
return tags;
}