Program: 13803
Project: 13803
Buggy source:
@SuppressWarnings("String_Node_Str") public boolean playStream() throws Exception {
  H264Decoder codec=null;
  MpegEncContext c=null;
  int frame, len;
  int[] got_picture=new int[1];
  AVFrame picture;
  byte[] inbuf=new byte[INBUF_SIZE + MpegEncContext.FF_INPUT_BUFFER_PADDING_SIZE];
  int[] inbuf_int=new int[INBUF_SIZE + MpegEncContext.FF_INPUT_BUFFER_PADDING_SIZE];
  AVPacket avpkt=new AVPacket();
  avpkt.av_init_packet();
  Arrays.fill(inbuf,INBUF_SIZE,MpegEncContext.FF_INPUT_BUFFER_PADDING_SIZE + INBUF_SIZE,(byte)0);
  System.out.println("String_Node_Str");
  codec=new H264Decoder();
  if (codec == null) {
    System.out.println("String_Node_Str");
    throw new RuntimeException("String_Node_Str");
  }
  c=MpegEncContext.avcodec_alloc_context();
  picture=AVFrame.avcodec_alloc_frame();
  if ((codec.capabilities & H264Decoder.CODEC_CAP_TRUNCATED) != 0)   c.flags|=MpegEncContext.CODEC_FLAG_TRUNCATED;
  if (c.avcodec_open(codec) < 0) {
    System.out.println("String_Node_Str");
    throw new RuntimeException("String_Node_Str");
  }
  try {
    frame=0;
    int dataPointer;
    int[] cacheRead=new int[3];
    cacheRead[0]=stream.read();
    cacheRead[1]=stream.read();
    cacheRead[2]=stream.read();
    while (!(cacheRead[0] == 0x00 && cacheRead[1] == 0x00 && cacheRead[2] == 0x01)) {
      cacheRead[0]=cacheRead[1];
      cacheRead[1]=cacheRead[2];
      cacheRead[2]=stream.read();
    }
    boolean hasMoreNAL=true;
    inbuf_int[0]=inbuf_int[1]=inbuf_int[2]=0x00;
    inbuf_int[3]=0x01;
    while (hasMoreNAL) {
      dataPointer=4;
      cacheRead[0]=stream.read();
      if (cacheRead[0] == -1)       hasMoreNAL=false;
      cacheRead[1]=stream.read();
      if (cacheRead[1] == -1)       hasMoreNAL=false;
      cacheRead[2]=stream.read();
      if (cacheRead[2] == -1)       hasMoreNAL=false;
      while (!(cacheRead[0] == 0x00 && cacheRead[1] == 0x00 && cacheRead[2] == 0x01) && hasMoreNAL) {
        inbuf_int[dataPointer++]=cacheRead[0];
        cacheRead[0]=cacheRead[1];
        cacheRead[1]=cacheRead[2];
        cacheRead[2]=stream.read();
        if (cacheRead[2] == -1)         hasMoreNAL=false;
      }
      avpkt.size=dataPointer;
      avpkt.data_base=inbuf_int;
      avpkt.data_offset=0;
      try {
        while (avpkt.size > 0) {
          len=c.avcodec_decode_video2(picture,got_picture,avpkt);
          if (len < 0) {
            break;
          }
          if (got_picture[0] != 0) {
            picture=c.priv_data.displayPicture;
            callback.imageUpdated(picture);
            ++frame;
          }
          avpkt.size-=len;
          avpkt.data_offset+=len;
        }
      }
 catch (      Exception ie) {
        ie.printStackTrace();
      }
    }
  }
  finally {
    c.avcodec_close();
    c=null;
    picture=null;
    System.out.println("String_Node_Str");
  }
  return true;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public boolean playStream() throws Exception {
  H264Decoder codec=null;
  MpegEncContext c=null;
  int frame, len;
  int[] got_picture=new int[1];
  AVFrame picture;
  byte[] inbuf=new byte[INBUF_SIZE + MpegEncContext.FF_INPUT_BUFFER_PADDING_SIZE];
  int[] inbuf_int=new int[INBUF_SIZE + MpegEncContext.FF_INPUT_BUFFER_PADDING_SIZE];
  AVPacket avpkt=new AVPacket();
  avpkt.av_init_packet();
  Arrays.fill(inbuf,INBUF_SIZE,MpegEncContext.FF_INPUT_BUFFER_PADDING_SIZE + INBUF_SIZE,(byte)0);
  System.out.println("String_Node_Str");
  codec=new H264Decoder();
  if (codec == null) {
    System.out.println("String_Node_Str");
    throw new RuntimeException("String_Node_Str");
  }
  c=MpegEncContext.avcodec_alloc_context();
  picture=AVFrame.avcodec_alloc_frame();
  if ((codec.capabilities & H264Decoder.CODEC_CAP_TRUNCATED) != 0)   c.flags|=MpegEncContext.CODEC_FLAG_TRUNCATED;
  if (c.avcodec_open(codec) < 0) {
    System.out.println("String_Node_Str");
    throw new RuntimeException("String_Node_Str");
  }
  try {
    frame=0;
    int dataPointer;
    int[] cacheRead=new int[3];
    cacheRead[0]=stream.read();
    cacheRead[1]=stream.read();
    cacheRead[2]=stream.read();
    while (!(cacheRead[0] == 0x00 && cacheRead[1] == 0x00 && cacheRead[2] == 0x01)) {
      cacheRead[0]=cacheRead[1];
      cacheRead[1]=cacheRead[2];
      cacheRead[2]=stream.read();
    }
    boolean hasMoreNAL=true;
    inbuf_int[0]=inbuf_int[1]=inbuf_int[2]=0x00;
    inbuf_int[3]=0x01;
    while (hasMoreNAL) {
      dataPointer=4;
      cacheRead[0]=stream.read();
      if (cacheRead[0] == -1)       hasMoreNAL=false;
      cacheRead[1]=stream.read();
      if (cacheRead[1] == -1)       hasMoreNAL=false;
      cacheRead[2]=stream.read();
      if (cacheRead[2] == -1)       hasMoreNAL=false;
      while (!(cacheRead[0] == 0x00 && cacheRead[1] == 0x00 && cacheRead[2] == 0x01) && hasMoreNAL) {
        inbuf_int[dataPointer++]=cacheRead[0];
        cacheRead[0]=cacheRead[1];
        cacheRead[1]=cacheRead[2];
        cacheRead[2]=stream.read();
        if (cacheRead[2] == -1)         hasMoreNAL=false;
      }
      avpkt.size=dataPointer;
      avpkt.data_base=inbuf_int;
      avpkt.data_offset=0;
      try {
        while (avpkt.size > 0) {
          len=c.avcodec_decode_video2(picture,got_picture,avpkt);
          if (len < 0) {
            if (DEBUG)             System.out.println("String_Node_Str" + len);
            break;
          }
          if (got_picture[0] != 0) {
            picture=c.priv_data.displayPicture;
            callback.imageUpdated(picture);
            ++frame;
          }
 else {
            if (DEBUG)             System.out.println("String_Node_Str" + got_picture[0]);
            break;
          }
          avpkt.size-=len;
          avpkt.data_offset+=len;
        }
      }
 catch (      Exception ie) {
        ie.printStackTrace();
      }
    }
  }
  finally {
    c.avcodec_close();
    c=null;
    picture=null;
    System.out.println("String_Node_Str");
  }
  if (DEBUG)   System.out.println("String_Node_Str");
  return true;
}