Program: 34502
Project: 34502
Buggy source:
protected void load(String bffFileName) throws GkTechnicalException {
  try {
    URL url=new URL("String_Node_Str" + bffFileName);
    InputStream uStream=url.openConnection().getInputStream();
    byte[] head=new byte[20];
    int bytesRead=uStream.read(head,0,20);
    LOG.info("String_Node_Str");
    if (bytesRead < 20) {
      throw new IOException("String_Node_Str");
    }
    ByteBuffer headBuf=ByteBuffer.wrap(head);
    int h0=getUnsignedByteVal(headBuf.get());
    int h1=getUnsignedByteVal(headBuf.get());
    if (h0 != 0xBF || h1 != 0xF2) {
      uStream.close();
      throw new IOException("String_Node_Str");
    }
    LOG.info("String_Node_Str");
    textureWidth=flipEndian(headBuf.getInt());
    textureHeight=flipEndian(headBuf.getInt());
    LOG.info("String_Node_Str" + textureWidth);
    LOG.info("String_Node_Str" + textureHeight);
    cellWidth=flipEndian(headBuf.getInt());
    cellHeight=flipEndian(headBuf.getInt());
    LOG.info("String_Node_Str" + cellWidth);
    LOG.info("String_Node_Str" + cellHeight);
    if (cellWidth <= 0 || cellHeight <= 0) {
      throw new IOException("String_Node_Str");
    }
    columnCount=textureWidth / cellWidth;
    bitsPerPixel=getUnsignedByteVal(headBuf.get());
    firstCharOffset=getUnsignedByteVal(headBuf.get());
    LOG.info("String_Node_Str" + columnCount);
    LOG.info("String_Node_Str" + bitsPerPixel);
    LOG.info("String_Node_Str" + firstCharOffset);
    for (int wLoop=0; wLoop < 256; ++wLoop) {
      charWidth[wLoop]=uStream.read();
    }
    int bitLen=(textureHeight * textureWidth) * (bitsPerPixel / 8);
    byte bits[]=new byte[bitLen];
    LOG.info("String_Node_Str" + bitLen);
    int received=0;
    do {
      received+=uStream.read(bits,received,bitLen - received);
    }
 while (uStream.available() > 0);
    pix=ByteBuffer.allocate(bits.length);
    pix.rewind();
    int lineLen=textureWidth * (bitsPerPixel / 8);
    LOG.info("String_Node_Str" + lineLen);
    for (int lines=textureHeight - 1; lines > 0; --lines) {
      pix.put(bits,lines * lineLen,lineLen);
    }
    pix.rewind();
    uStream.close();
  }
 catch (  IOException e) {
    throw new GkTechnicalException(e);
  }
}

Fixed version (ground truth):
protected void load(String bffFileName) throws GkTechnicalException {
  try {
    URL url=new URL("String_Node_Str" + bffFileName);
    InputStream uStream=url.openConnection().getInputStream();
    byte[] head=new byte[20];
    int bytesRead=uStream.read(head,0,20);
    if (bytesRead < 20) {
      throw new IOException("String_Node_Str");
    }
    ByteBuffer headBuf=ByteBuffer.wrap(head);
    int h0=getUnsignedByteVal(headBuf.get());
    int h1=getUnsignedByteVal(headBuf.get());
    if (h0 != 0xBF || h1 != 0xF2) {
      uStream.close();
      throw new IOException("String_Node_Str");
    }
    textureWidth=flipEndian(headBuf.getInt());
    textureHeight=flipEndian(headBuf.getInt());
    cellWidth=flipEndian(headBuf.getInt());
    cellHeight=flipEndian(headBuf.getInt());
    if (cellWidth <= 0 || cellHeight <= 0) {
      throw new IOException("String_Node_Str");
    }
    columnCount=textureWidth / cellWidth;
    bitsPerPixel=getUnsignedByteVal(headBuf.get());
    firstCharOffset=getUnsignedByteVal(headBuf.get());
    for (int wLoop=0; wLoop < 256; ++wLoop) {
      charWidth[wLoop]=uStream.read();
    }
    int bitLen=(textureHeight * textureWidth) * (bitsPerPixel / 8);
    byte bits[]=new byte[bitLen];
    int received=0;
    do {
      received+=uStream.read(bits,received,bitLen - received);
    }
 while (uStream.available() > 0);
    pix=ByteBuffer.allocate(bits.length);
    pix.rewind();
    int lineLen=textureWidth * (bitsPerPixel / 8);
    for (int lines=textureHeight - 1; lines > 0; --lines) {
      pix.put(bits,lines * lineLen,lineLen);
    }
    pix.rewind();
    uStream.close();
  }
 catch (  IOException e) {
    throw new GkTechnicalException(e);
  }
}