public boolean read_sampledata (Bitstream stream)
	  {
	  	if (allocation != 0)
		 if (groupingtable[0] != null)
		 {
			int samplecode = stream.get_bits(codelength[0]);
			// create requantized samples:
			samplecode += samplecode << 1;
			float[] target = samples;
			float[] source = groupingtable[0];
		  /*
		  int tmp = 0;
			int temp = 0;
			target[tmp++] = source[samplecode + temp];
			temp++;
			target[tmp++] = source[samplecode + temp];
			temp++;
			target[tmp] = source[samplecode + temp];
			*/
			//Bugfix:
			int tmp = 0;
			int temp = samplecode;
			
			if(temp > source.length - 3) temp = source.length - 3;
			
			target[tmp] = source[temp];
			temp++;tmp++;
			target[tmp] = source[temp];
			temp++;tmp++;
			target[tmp] = source[temp];
			
			// memcpy (samples, groupingtable + samplecode, 3 * sizeof (real));
		 }
		 else
		 {
			samples[0] = (float) ((stream.get_bits(codelength[0])) * factor[0] - 1.0);
			samples[1] = (float) ((stream.get_bits(codelength[0])) * factor[0] - 1.0);
			samples[2] = (float) ((stream.get_bits(codelength[0])) * factor[0] - 1.0);
		 }

	  	samplenumber = 0;
		  if (++groupnumber == 12)
			 return true;
		  else
			 return false;
	  }