Program: 61441
Project: 61441
Buggy source:
private void processCommands(int shapeNum,SHAPEWITHSTYLE shapes,List<PathCommand> commands,Matrix transform,SvgStyle style){
  Matrix transform2=transform.preConcatenate(Matrix.getScaleInstance(SWF.unitDivisor));
  Point prevPoint=new Point(0,0);
  Point startPoint=prevPoint;
  double x0=0;
  double y0=0;
  StyleChangeRecord scrStyle=getStyleChangeRecord(shapeNum,style);
  int fillStyle=scrStyle.fillStyle1;
  int lineStyle=scrStyle.lineStyle;
  scrStyle.stateFillStyle0=true;
  scrStyle.stateFillStyle1=true;
  scrStyle.stateLineStyle=true;
  scrStyle.fillStyle0=0;
  scrStyle.fillStyle1=0;
  scrStyle.lineStyle=0;
  List<SHAPERECORD> newRecords=new ArrayList<>();
  newRecords.add(scrStyle);
  LINESTYLE lineStyleObj=scrStyle.lineStyles.lineStyles.length < 1 ? null : scrStyle.lineStyles.lineStyles[0];
  LINESTYLE2 lineStyle2Obj=null;
  if (lineStyleObj instanceof LINESTYLE2) {
    lineStyle2Obj=(LINESTYLE2)lineStyleObj;
    lineStyle2Obj.noClose=true;
  }
  for (  PathCommand command : commands) {
    double x=x0;
    double y=y0;
    Point p;
    char cmd=Character.toUpperCase(command.command);
switch (cmd) {
case 'M':
      StyleChangeRecord scr=new StyleChangeRecord();
    if (fillStyle != 0) {
      scr.stateFillStyle1=true;
      scr.fillStyle1=fillStyle;
    }
  if (lineStyle != 0) {
    scr.lineStyle=lineStyle;
    scr.stateLineStyle=true;
  }
x=command.params[0];
y=command.params[1];
p=transform2.transform(x,y);
scr.moveDeltaX=(int)Math.round(p.x);
scr.moveDeltaY=(int)Math.round(p.y);
prevPoint=p;
scr.stateMoveTo=true;
newRecords.add(scr);
startPoint=p;
break;
case 'Z':
StraightEdgeRecord serz=new StraightEdgeRecord();
p=startPoint;
serz.deltaX=(int)Math.round(p.x - prevPoint.x);
serz.deltaY=(int)Math.round(p.y - prevPoint.y);
prevPoint=p;
serz.generalLineFlag=true;
newRecords.add(serz);
if (lineStyle2Obj != null) {
lineStyle2Obj.noClose=false;
}
break;
case 'L':
StraightEdgeRecord serl=new StraightEdgeRecord();
x=command.params[0];
y=command.params[1];
p=transform2.transform(x,y);
serl.deltaX=(int)Math.round(p.x - prevPoint.x);
serl.deltaY=(int)Math.round(p.y - prevPoint.y);
prevPoint=p;
serl.generalLineFlag=true;
serl.simplify();
newRecords.add(serl);
break;
case 'H':
StraightEdgeRecord serh=new StraightEdgeRecord();
x=command.params[0];
p=transform2.transform(x,y);
serh.deltaX=(int)Math.round(p.x - prevPoint.x);
prevPoint=p;
newRecords.add(serh);
break;
case 'V':
StraightEdgeRecord serv=new StraightEdgeRecord();
y=command.params[0];
p=transform2.transform(x,y);
serv.deltaY=(int)Math.round(p.y - prevPoint.y);
prevPoint=p;
serv.vertLineFlag=true;
newRecords.add(serv);
break;
case 'Q':
CurvedEdgeRecord cer=new CurvedEdgeRecord();
x=command.params[0];
y=command.params[1];
p=transform2.transform(x,y);
cer.controlDeltaX=(int)Math.round(p.x - prevPoint.x);
cer.controlDeltaY=(int)Math.round(p.y - prevPoint.y);
prevPoint=p;
x=command.params[2];
y=command.params[3];
p=transform2.transform(x,y);
cer.anchorDeltaX=(int)Math.round(p.x - prevPoint.x);
cer.anchorDeltaY=(int)Math.round(p.y - prevPoint.y);
prevPoint=p;
newRecords.add(cer);
break;
case 'C':
showWarning("String_Node_Str","String_Node_Str");
Point pStart=prevPoint;
Point pControl1;
x=command.params[0];
y=command.params[1];
pControl1=transform2.transform(x,y);
x=command.params[2];
y=command.params[3];
Point pControl2=transform2.transform(x,y);
x=command.params[4];
y=command.params[5];
p=transform2.transform(x,y);
List<Double> quadCoordinates=new CubicToQuad().cubicToQuad(pStart.x,pStart.y,pControl1.x,pControl1.y,pControl2.x,pControl2.y,p.x,p.y,1);
for (int i=2; i < quadCoordinates.size(); ) {
CurvedEdgeRecord cerc=new CurvedEdgeRecord();
p=new Point(quadCoordinates.get(i++),quadCoordinates.get(i++));
cerc.controlDeltaX=(int)Math.round(p.x - prevPoint.x);
cerc.controlDeltaY=(int)Math.round(p.y - prevPoint.y);
prevPoint=p;
p=new Point(quadCoordinates.get(i++),quadCoordinates.get(i++));
cerc.anchorDeltaX=(int)Math.round(p.x - prevPoint.x);
cerc.anchorDeltaY=(int)Math.round(p.y - prevPoint.y);
prevPoint=p;
newRecords.add(cerc);
}
break;
default :
Logger.getLogger(ShapeImporter.class.getName()).log(Level.WARNING,"String_Node_Str",command);
return;
}
x0=x;
y0=y;
}
applyStyleGradients(SHAPERECORD.getBounds(newRecords),scrStyle,transform2,shapeNum,style);
shapes.shapeRecords.addAll(newRecords);
}

Fixed version (ground truth):
private void processCommands(int shapeNum,SHAPEWITHSTYLE shapes,List<PathCommand> commands,Matrix transform,SvgStyle style){
  Matrix transform2=transform.preConcatenate(Matrix.getScaleInstance(SWF.unitDivisor));
  Point prevPoint=new Point(0,0);
  Point startPoint=prevPoint;
  double x0=0;
  double y0=0;
  StyleChangeRecord scrStyle=getStyleChangeRecord(shapeNum,style);
  int fillStyle=scrStyle.fillStyle1;
  int lineStyle=scrStyle.lineStyle;
  scrStyle.stateFillStyle0=true;
  scrStyle.stateFillStyle1=true;
  scrStyle.stateLineStyle=true;
  scrStyle.fillStyle0=0;
  scrStyle.fillStyle1=0;
  scrStyle.lineStyle=0;
  List<SHAPERECORD> newRecords=new ArrayList<>();
  newRecords.add(scrStyle);
  LINESTYLE lineStyleObj=scrStyle.lineStyles.lineStyles.length < 1 ? null : scrStyle.lineStyles.lineStyles[0];
  LINESTYLE2 lineStyle2Obj=null;
  if (lineStyleObj instanceof LINESTYLE2) {
    lineStyle2Obj=(LINESTYLE2)lineStyleObj;
    lineStyle2Obj.noClose=true;
  }
  for (  PathCommand command : commands) {
    double x=x0;
    double y=y0;
    Point p;
    boolean isRelative=Character.isLowerCase(command.command);
    if (isRelative) {
      throw new Error("String_Node_Str");
    }
    char cmd=command.command;
switch (cmd) {
case 'M':
      StyleChangeRecord scr=new StyleChangeRecord();
    if (fillStyle != 0) {
      scr.stateFillStyle1=true;
      scr.fillStyle1=fillStyle;
    }
  if (lineStyle != 0) {
    scr.lineStyle=lineStyle;
    scr.stateLineStyle=true;
  }
x=command.params[0];
y=command.params[1];
p=transform2.transform(x,y);
scr.moveDeltaX=(int)Math.round(p.x);
scr.moveDeltaY=(int)Math.round(p.y);
prevPoint=new Point(scr.moveDeltaX,scr.moveDeltaY);
scr.stateMoveTo=true;
newRecords.add(scr);
startPoint=prevPoint;
break;
case 'Z':
StraightEdgeRecord serz=new StraightEdgeRecord();
p=startPoint;
serz.deltaX=(int)Math.round(p.x - prevPoint.x);
serz.deltaY=(int)Math.round(p.y - prevPoint.y);
prevPoint=new Point(prevPoint.x + serz.deltaX,prevPoint.y + serz.deltaY);
serz.generalLineFlag=true;
newRecords.add(serz);
if (lineStyle2Obj != null) {
lineStyle2Obj.noClose=false;
}
break;
case 'L':
StraightEdgeRecord serl=new StraightEdgeRecord();
x=command.params[0];
y=command.params[1];
p=transform2.transform(x,y);
serl.deltaX=(int)Math.round(p.x - prevPoint.x);
serl.deltaY=(int)Math.round(p.y - prevPoint.y);
prevPoint=new Point(prevPoint.x + serl.deltaX,prevPoint.y + serl.deltaY);
serl.generalLineFlag=true;
serl.simplify();
newRecords.add(serl);
break;
case 'H':
StraightEdgeRecord serh=new StraightEdgeRecord();
x=command.params[0];
p=transform2.transform(x,y);
serh.deltaX=(int)Math.round(p.x - prevPoint.x);
prevPoint=new Point(prevPoint.x + serh.deltaX,prevPoint.y);
newRecords.add(serh);
break;
case 'V':
StraightEdgeRecord serv=new StraightEdgeRecord();
y=command.params[0];
p=transform2.transform(x,y);
serv.deltaY=(int)Math.round(p.y - prevPoint.y);
prevPoint=new Point(prevPoint.x,prevPoint.y + serv.deltaY);
serv.vertLineFlag=true;
newRecords.add(serv);
break;
case 'Q':
CurvedEdgeRecord cer=new CurvedEdgeRecord();
x=command.params[0];
y=command.params[1];
p=transform2.transform(x,y);
cer.controlDeltaX=(int)Math.round(p.x - prevPoint.x);
cer.controlDeltaY=(int)Math.round(p.y - prevPoint.y);
prevPoint=new Point(prevPoint.x + cer.controlDeltaX,prevPoint.y + cer.controlDeltaY);
x=command.params[2];
y=command.params[3];
p=transform2.transform(x,y);
cer.anchorDeltaX=(int)Math.round(p.x - prevPoint.x);
cer.anchorDeltaY=(int)Math.round(p.y - prevPoint.y);
prevPoint=new Point(prevPoint.x + cer.anchorDeltaX,prevPoint.y + cer.anchorDeltaY);
newRecords.add(cer);
break;
case 'C':
showWarning("String_Node_Str","String_Node_Str");
Point pStart=prevPoint;
Point pControl1;
x=command.params[0];
y=command.params[1];
pControl1=transform2.transform(x,y);
x=command.params[2];
y=command.params[3];
Point pControl2=transform2.transform(x,y);
x=command.params[4];
y=command.params[5];
p=transform2.transform(x,y);
List<Double> quadCoordinates=new CubicToQuad().cubicToQuad(pStart.x,pStart.y,pControl1.x,pControl1.y,pControl2.x,pControl2.y,p.x,p.y,1);
for (int i=2; i < quadCoordinates.size(); ) {
CurvedEdgeRecord cerc=new CurvedEdgeRecord();
p=new Point(quadCoordinates.get(i++),quadCoordinates.get(i++));
cerc.controlDeltaX=(int)Math.round(p.x - prevPoint.x);
cerc.controlDeltaY=(int)Math.round(p.y - prevPoint.y);
prevPoint=new Point(prevPoint.x + cerc.controlDeltaX,prevPoint.y + cerc.controlDeltaY);
p=new Point(quadCoordinates.get(i++),quadCoordinates.get(i++));
cerc.anchorDeltaX=(int)Math.round(p.x - prevPoint.x);
cerc.anchorDeltaY=(int)Math.round(p.y - prevPoint.y);
prevPoint=new Point(prevPoint.x + cerc.anchorDeltaX,prevPoint.y + cerc.anchorDeltaY);
newRecords.add(cerc);
}
break;
default :
Logger.getLogger(ShapeImporter.class.getName()).log(Level.WARNING,"String_Node_Str",command);
return;
}
x0=x;
y0=y;
}
applyStyleGradients(SHAPERECORD.getBounds(newRecords),scrStyle,transform2,shapeNum,style);
shapes.shapeRecords.addAll(newRecords);
}