Program: 151774
Project: 151774
Buggy source:
@Override protected Object decode(ChannelHandlerContext ctx,Channel channel,Object msg) throws Exception {
  RaopRtpPacket.Audio alacPacket=(RaopRtpPacket.Audio)msg;
  final byte[] alacBytes=new byte[alacPacket.getPayload().capacity() + 3];
  alacPacket.getPayload().getBytes(0,alacBytes,0,alacPacket.getPayload().capacity());
  final int[] pcmSamples=new int[m_samplesPerFrame * 2];
  final int pcmSamplesBytes=AlacDecodeUtils.decode_frame(m_alacFile,alacBytes,pcmSamples,m_samplesPerFrame);
  final int pcmSamplesLength=pcmSamplesBytes / 4;
  Level level=Level.FINEST;
  if (s_logger.isLoggable(level))   s_logger.log(level,"String_Node_Str" + alacBytes.length + "String_Node_Str"+ pcmSamplesLength+ "String_Node_Str");
  if (pcmSamplesLength != m_samplesPerFrame)   throw new ProtocolException("String_Node_Str" + m_samplesPerFrame + "String_Node_Str"+ pcmSamplesLength);
  RaopRtpPacket.Audio pcmPacket;
  if (alacPacket instanceof RaopRtpPacket.AudioTransmit) {
    pcmPacket=new RaopRtpPacket.AudioTransmit(pcmSamplesLength * 4);
    alacPacket.getBuffer().getBytes(0,pcmPacket.getBuffer(),0,RaopRtpPacket.AudioTransmit.HeaderLength);
  }
 else   if (alacPacket instanceof RaopRtpPacket.AudioRetransmit) {
    pcmPacket=new RaopRtpPacket.AudioRetransmit(pcmSamplesLength * 4);
    alacPacket.getBuffer().getBytes(0,pcmPacket.getBuffer(),0,RaopRtpPacket.AudioRetransmit.HeaderLength);
  }
 else   throw new ProtocolException("String_Node_Str" + alacPacket.getClass() + "String_Node_Str");
  for (int i=0; i < pcmSamples.length; ++i) {
    int pcmSampleUnsigned=pcmSamples[i] + 0x8000;
    pcmPacket.getPayload().setByte(2 * i,(pcmSampleUnsigned & 0xff00) >> 8);
    pcmPacket.getPayload().setByte(2 * i + 1,pcmSampleUnsigned & 0x00ff);
  }
  return pcmPacket;
}

Fixed version (ground truth):
@Override protected Object decode(ChannelHandlerContext ctx,Channel channel,Object msg) throws Exception {
  RaopRtpPacket.Audio alacPacket=(RaopRtpPacket.Audio)msg;
  final byte[] alacBytes=new byte[alacPacket.getPayload().capacity() + 3];
  alacPacket.getPayload().getBytes(0,alacBytes,0,alacPacket.getPayload().capacity());
  final int[] pcmSamples=new int[m_samplesPerFrame * 2];
  final int pcmSamplesBytes=AlacDecodeUtils.decode_frame(m_alacFile,alacBytes,pcmSamples,m_samplesPerFrame);
  final int pcmSamplesLength=pcmSamplesBytes / 4;
  Level level=Level.FINEST;
  if (s_logger.isLoggable(level))   s_logger.log(level,"String_Node_Str" + alacBytes.length + "String_Node_Str"+ pcmSamplesLength+ "String_Node_Str");
  if (pcmSamplesLength != m_samplesPerFrame)   throw new ProtocolException("String_Node_Str" + m_samplesPerFrame + "String_Node_Str"+ pcmSamplesLength);
  RaopRtpPacket.Audio pcmPacket;
  if (alacPacket instanceof RaopRtpPacket.AudioTransmit) {
    pcmPacket=new RaopRtpPacket.AudioTransmit(pcmSamplesLength * 4);
    alacPacket.getBuffer().getBytes(0,pcmPacket.getBuffer(),0,RaopRtpPacket.AudioTransmit.Length);
  }
 else   if (alacPacket instanceof RaopRtpPacket.AudioRetransmit) {
    pcmPacket=new RaopRtpPacket.AudioRetransmit(pcmSamplesLength * 4);
    alacPacket.getBuffer().getBytes(0,pcmPacket.getBuffer(),0,RaopRtpPacket.AudioRetransmit.Length);
  }
 else   throw new ProtocolException("String_Node_Str" + alacPacket.getClass() + "String_Node_Str");
  for (int i=0; i < pcmSamples.length; ++i) {
    int pcmSampleUnsigned=pcmSamples[i] + 0x8000;
    pcmPacket.getPayload().setByte(2 * i,(pcmSampleUnsigned & 0xff00) >> 8);
    pcmPacket.getPayload().setByte(2 * i + 1,pcmSampleUnsigned & 0x00ff);
  }
  return pcmPacket;
}