code: public void fixSampleLoops(int modType)
  	{
  		if (sample==null || length==0) return;
  		if (repeatStop>length)
  		{
  			repeatStop = length;
  			repeatLength = repeatStop - repeatStart;
  		}
  		if (repeatStart+2>repeatStop)
  		{
  			repeatStop = repeatStart = 0;
  			repeatLength = repeatStop - repeatStart;
  			loopType = 0;
  		}
  		sample[length+4] = sample[length+3] = sample[length+2] = sample[length+1] = sample[length] = sample[length-1];
  		if (loopType==1 && (repeatStop+4>repeatLength || modType==Helpers.MODTYPE_MOD || modType==Helpers.MODTYPE_S3M))
  		{
  			sample[repeatStop  ] = sample[repeatStart  ];
  			sample[repeatStop+1] = sample[repeatStart+1];
  			sample[repeatStop+2] = sample[repeatStart+2];
  			sample[repeatStop+3] = sample[repeatStart+3];
  			sample[repeatStop+4] = sample[repeatStart+4];
  		}
  	}
docs: Fits the loop-data given in instruments loaded
  These values are often not correkt
  @since 27.08.2006
  @param modType