Program: 61551
Project: 61551
Buggy source:
private static void convertFrames(String prevStr,String afterStr,List<Integer> nonLibraryShapes,List<Tag> tags,List<Tag> timelineTags,HashMap<Integer,CharacterTag> characters,int depth,FLAVersion flaVersion,HashMap<String,byte[]> files,StringBuilder ret){
  StringBuilder ret2=new StringBuilder();
  prevStr+="String_Node_Str";
  int frame=-1;
  String elements;
  String lastElements="String_Node_Str";
  int duration=1;
  CharacterTag character=null;
  MATRIX matrix=null;
  String instanceName=null;
  ColorTransform colorTransForm=null;
  boolean cacheAsBitmap=false;
  int blendMode=0;
  List<FILTER> filters=new ArrayList<>();
  boolean isVisible=true;
  RGBA backGroundColor=null;
  CLIPACTIONS clipActions=null;
  int characterId=-1;
  int ratio=-1;
  boolean shapeTween=false;
  boolean lastShapeTween=false;
  MorphShapeTag shapeTweener=null;
  for (  Tag t : timelineTags) {
    if (t instanceof PlaceObjectTypeTag) {
      PlaceObjectTypeTag po=(PlaceObjectTypeTag)t;
      if (po.getDepth() == depth) {
        int newCharId=po.getCharacterId();
        if (newCharId == -1) {
          newCharId=characterId;
        }
        characterId=newCharId;
        if (characters.containsKey(characterId)) {
          character=characters.get(characterId);
          if (po.flagMove()) {
            MATRIX matrix2=po.getMatrix();
            if (matrix2 != null) {
              matrix=matrix2;
            }
            String instanceName2=po.getInstanceName();
            if (instanceName2 != null) {
              instanceName=instanceName2;
            }
            ColorTransform colorTransForm2=po.getColorTransform();
            if (colorTransForm2 != null) {
              colorTransForm=colorTransForm2;
            }
            CLIPACTIONS clipActions2=po.getClipActions();
            if (clipActions2 != null) {
              clipActions=clipActions2;
            }
            if (po.cacheAsBitmap()) {
              cacheAsBitmap=true;
            }
            int blendMode2=po.getBlendMode();
            if (blendMode2 > 0) {
              blendMode=blendMode2;
            }
            List<FILTER> filters2=po.getFilters();
            if (filters2 != null) {
              filters=filters2;
            }
            int ratio2=po.getRatio();
            if (ratio2 > -1) {
              ratio=ratio2;
            }
          }
 else {
            matrix=po.getMatrix();
            instanceName=po.getInstanceName();
            colorTransForm=po.getColorTransform();
            cacheAsBitmap=po.cacheAsBitmap();
            blendMode=po.getBlendMode();
            filters=po.getFilters();
            ratio=po.getRatio();
            clipActions=po.getClipActions();
          }
        }
      }
    }
    if (t instanceof RemoveTag) {
      RemoveTag rt=(RemoveTag)t;
      if (rt.getDepth() == depth) {
        if (shapeTween && character != null) {
          MorphShapeTag m=(MorphShapeTag)character;
          shapeTweener=m;
          shapeTween=false;
        }
        character=null;
        matrix=null;
        instanceName=null;
        colorTransForm=null;
        cacheAsBitmap=false;
        blendMode=0;
        filters=new ArrayList<>();
        isVisible=true;
        backGroundColor=null;
        characterId=-1;
        clipActions=null;
      }
    }
    if (t instanceof ShowFrameTag) {
      if ((character instanceof ShapeTag) && (nonLibraryShapes.contains(characterId) || shapeTweener != null)) {
        ShapeTag shape=(ShapeTag)character;
        elements=convertShape(characters,matrix,shape.getShapeNum(),shape.getShapes().shapeRecords,shape.getShapes().fillStyles,shape.getShapes().lineStyles,false,false);
        shapeTween=false;
        shapeTweener=null;
      }
 else       if (character != null) {
        if (character instanceof MorphShapeTag) {
          MorphShapeTag m=(MorphShapeTag)character;
          elements=convertShape(characters,matrix,3,m.getStartEdges().shapeRecords,m.getFillStyles().getStartFillStyles(),m.getLineStyles().getStartLineStyles(m.getShapeNum()),true,false);
          shapeTween=true;
        }
 else {
          shapeTween=false;
          if (character instanceof TextTag) {
            elements=convertText(instanceName,(TextTag)character,matrix,filters,clipActions);
          }
 else           if (character instanceof DefineVideoStreamTag) {
            elements=convertVideoInstance(instanceName,matrix,(DefineVideoStreamTag)character,clipActions);
          }
 else {
            elements=convertSymbolInstance(instanceName,matrix,colorTransForm,cacheAsBitmap,blendMode,filters,isVisible,backGroundColor,clipActions,character,characters,tags,flaVersion);
          }
        }
      }
 else {
        elements="String_Node_Str";
      }
      frame++;
      if (!elements.equals(lastElements) && frame > 0) {
        convertFrame(lastShapeTween,characters,tags,null,null,frame - duration,duration,"String_Node_Str",lastElements,files,ret2);
        duration=1;
      }
 else       if (frame == 0) {
        duration=1;
      }
 else {
        duration++;
      }
      lastShapeTween=shapeTween;
      lastElements=elements;
    }
  }
  if (!lastElements.isEmpty()) {
    frame++;
    convertFrame(lastShapeTween,characters,tags,null,null,(frame - duration < 0 ? 0 : frame - duration),duration,"String_Node_Str",lastElements,files,ret2);
  }
  afterStr="String_Node_Str" + afterStr;
  if (ret2.length() > 0) {
    ret.append(prevStr).append(ret2).append(afterStr);
  }
}

Fixed version (ground truth):
private static void convertFrames(String prevStr,String afterStr,List<Integer> nonLibraryShapes,List<Tag> tags,List<Tag> timelineTags,HashMap<Integer,CharacterTag> characters,int depth,FLAVersion flaVersion,HashMap<String,byte[]> files,StringBuilder ret){
  StringBuilder ret2=new StringBuilder();
  prevStr+="String_Node_Str";
  int frame=-1;
  String elements;
  String lastElements="String_Node_Str";
  int duration=1;
  CharacterTag character=null;
  MATRIX matrix=null;
  String instanceName=null;
  ColorTransform colorTransForm=null;
  boolean cacheAsBitmap=false;
  int blendMode=0;
  List<FILTER> filters=new ArrayList<>();
  boolean isVisible=true;
  RGBA backGroundColor=null;
  CLIPACTIONS clipActions=null;
  int characterId=-1;
  int ratio=-1;
  boolean shapeTween=false;
  boolean lastShapeTween=false;
  MorphShapeTag shapeTweener=null;
  List<Tag> timTags=new ArrayList<>(timelineTags);
  boolean needsFrameAdd=false;
  SWF swf=null;
  for (int i=timTags.size() - 1; i >= 0; i--) {
    if (timTags.get(i) instanceof ShowFrameTag) {
      break;
    }
    if (timTags.get(i) instanceof PlaceObjectTypeTag) {
      needsFrameAdd=true;
      swf=timTags.get(i).getSwf();
      break;
    }
  }
  if (needsFrameAdd) {
    timTags.add(new ShowFrameTag(swf));
  }
  for (  Tag t : timTags) {
    if (t instanceof PlaceObjectTypeTag) {
      PlaceObjectTypeTag po=(PlaceObjectTypeTag)t;
      if (po.getDepth() == depth) {
        int newCharId=po.getCharacterId();
        if (newCharId == -1) {
          newCharId=characterId;
        }
        characterId=newCharId;
        if (characters.containsKey(characterId)) {
          character=characters.get(characterId);
          if (po.flagMove()) {
            MATRIX matrix2=po.getMatrix();
            if (matrix2 != null) {
              matrix=matrix2;
            }
            String instanceName2=po.getInstanceName();
            if (instanceName2 != null) {
              instanceName=instanceName2;
            }
            ColorTransform colorTransForm2=po.getColorTransform();
            if (colorTransForm2 != null) {
              colorTransForm=colorTransForm2;
            }
            CLIPACTIONS clipActions2=po.getClipActions();
            if (clipActions2 != null) {
              clipActions=clipActions2;
            }
            if (po.cacheAsBitmap()) {
              cacheAsBitmap=true;
            }
            int blendMode2=po.getBlendMode();
            if (blendMode2 > 0) {
              blendMode=blendMode2;
            }
            List<FILTER> filters2=po.getFilters();
            if (filters2 != null) {
              filters=filters2;
            }
            int ratio2=po.getRatio();
            if (ratio2 > -1) {
              ratio=ratio2;
            }
          }
 else {
            matrix=po.getMatrix();
            instanceName=po.getInstanceName();
            colorTransForm=po.getColorTransform();
            cacheAsBitmap=po.cacheAsBitmap();
            blendMode=po.getBlendMode();
            filters=po.getFilters();
            ratio=po.getRatio();
            clipActions=po.getClipActions();
          }
        }
      }
    }
    if (t instanceof RemoveTag) {
      RemoveTag rt=(RemoveTag)t;
      if (rt.getDepth() == depth) {
        if (shapeTween && character != null) {
          MorphShapeTag m=(MorphShapeTag)character;
          shapeTweener=m;
          shapeTween=false;
        }
        character=null;
        matrix=null;
        instanceName=null;
        colorTransForm=null;
        cacheAsBitmap=false;
        blendMode=0;
        filters=new ArrayList<>();
        isVisible=true;
        backGroundColor=null;
        characterId=-1;
        clipActions=null;
      }
    }
    if (t instanceof ShowFrameTag) {
      if ((character instanceof ShapeTag) && (nonLibraryShapes.contains(characterId) || shapeTweener != null)) {
        ShapeTag shape=(ShapeTag)character;
        elements=convertShape(characters,matrix,shape.getShapeNum(),shape.getShapes().shapeRecords,shape.getShapes().fillStyles,shape.getShapes().lineStyles,false,false);
        shapeTween=false;
        shapeTweener=null;
      }
 else       if (character != null) {
        if (character instanceof MorphShapeTag) {
          MorphShapeTag m=(MorphShapeTag)character;
          elements=convertShape(characters,matrix,3,m.getStartEdges().shapeRecords,m.getFillStyles().getStartFillStyles(),m.getLineStyles().getStartLineStyles(m.getShapeNum()),true,false);
          shapeTween=true;
        }
 else {
          shapeTween=false;
          if (character instanceof TextTag) {
            elements=convertText(instanceName,(TextTag)character,matrix,filters,clipActions);
          }
 else           if (character instanceof DefineVideoStreamTag) {
            elements=convertVideoInstance(instanceName,matrix,(DefineVideoStreamTag)character,clipActions);
          }
 else {
            elements=convertSymbolInstance(instanceName,matrix,colorTransForm,cacheAsBitmap,blendMode,filters,isVisible,backGroundColor,clipActions,character,characters,tags,flaVersion);
          }
        }
      }
 else {
        elements="String_Node_Str";
      }
      frame++;
      if (!elements.equals(lastElements) && frame > 0) {
        convertFrame(lastShapeTween,characters,tags,null,null,frame - duration,duration,"String_Node_Str",lastElements,files,ret2);
        duration=1;
      }
 else       if (frame == 0) {
        duration=1;
      }
 else {
        duration++;
      }
      lastShapeTween=shapeTween;
      lastElements=elements;
    }
  }
  if (!lastElements.isEmpty()) {
    frame++;
    convertFrame(lastShapeTween,characters,tags,null,null,(frame - duration < 0 ? 0 : frame - duration),duration,"String_Node_Str",lastElements,files,ret2);
  }
  afterStr="String_Node_Str" + afterStr;
  if (ret2.length() > 0) {
    ret.append(prevStr).append(ret2).append(afterStr);
  }
}