Program: 92872
Project: 92872
Buggy source:
private static GifHeaderDirectory readGifHeader(@NotNull final SequentialReader reader) throws IOException {
  GifHeaderDirectory headerDirectory=new GifHeaderDirectory();
  String signature=reader.getString(3);
  if (!signature.equals("String_Node_Str")) {
    headerDirectory.addError("String_Node_Str");
    return headerDirectory;
  }
  String version=reader.getString(3);
  if (!version.equals(GIF_87A_VERSION_IDENTIFIER) && !version.equals(GIF_89A_VERSION_IDENTIFIER)) {
    headerDirectory.addError("String_Node_Str");
    return headerDirectory;
  }
  headerDirectory.setString(GifHeaderDirectory.TAG_GIF_FORMAT_VERSION,version);
  headerDirectory.setInt(GifHeaderDirectory.TAG_IMAGE_WIDTH,reader.getUInt16());
  headerDirectory.setInt(GifHeaderDirectory.TAG_IMAGE_HEIGHT,reader.getUInt16());
  short flags=reader.getUInt8();
  int colorTableSize=1 << ((flags & 7) + 1);
  int bitsPerPixel=((flags & 0x70) >> 4) + 1;
  boolean hasGlobalColorTable=(flags & 0xf) != 0;
  headerDirectory.setInt(GifHeaderDirectory.TAG_COLOR_TABLE_SIZE,colorTableSize);
  if (version.equals(GIF_89A_VERSION_IDENTIFIER)) {
    boolean isColorTableSorted=(flags & 8) != 0;
    headerDirectory.setBoolean(GifHeaderDirectory.TAG_IS_COLOR_TABLE_SORTED,isColorTableSorted);
  }
  headerDirectory.setInt(GifHeaderDirectory.TAG_BITS_PER_PIXEL,bitsPerPixel);
  headerDirectory.setBoolean(GifHeaderDirectory.TAG_HAS_GLOBAL_COLOR_TABLE,hasGlobalColorTable);
  headerDirectory.setInt(GifHeaderDirectory.TAG_BACKGROUND_COLOR_INDEX,reader.getUInt8());
  int aspectRatioByte=reader.getUInt8();
  if (aspectRatioByte != 0) {
    float pixelAspectRatio=(float)((aspectRatioByte + 15d) / 64d);
    headerDirectory.setFloat(GifHeaderDirectory.TAG_PIXEL_ASPECT_RATIO,pixelAspectRatio);
  }
  return headerDirectory;
}

Fixed version (ground truth):
private static GifHeaderDirectory readGifHeader(@NotNull final SequentialReader reader) throws IOException {
  GifHeaderDirectory headerDirectory=new GifHeaderDirectory();
  String signature=reader.getString(3);
  if (!signature.equals("String_Node_Str")) {
    headerDirectory.addError("String_Node_Str");
    return headerDirectory;
  }
  String version=reader.getString(3);
  if (!version.equals(GIF_87A_VERSION_IDENTIFIER) && !version.equals(GIF_89A_VERSION_IDENTIFIER)) {
    headerDirectory.addError("String_Node_Str");
    return headerDirectory;
  }
  headerDirectory.setString(GifHeaderDirectory.TAG_GIF_FORMAT_VERSION,version);
  headerDirectory.setInt(GifHeaderDirectory.TAG_IMAGE_WIDTH,reader.getUInt16());
  headerDirectory.setInt(GifHeaderDirectory.TAG_IMAGE_HEIGHT,reader.getUInt16());
  short flags=reader.getUInt8();
  int colorTableSize=1 << ((flags & 7) + 1);
  int bitsPerPixel=((flags & 0x70) >> 4) + 1;
  boolean hasGlobalColorTable=(flags >> 7) != 0;
  headerDirectory.setInt(GifHeaderDirectory.TAG_COLOR_TABLE_SIZE,colorTableSize);
  if (version.equals(GIF_89A_VERSION_IDENTIFIER)) {
    boolean isColorTableSorted=(flags & 8) != 0;
    headerDirectory.setBoolean(GifHeaderDirectory.TAG_IS_COLOR_TABLE_SORTED,isColorTableSorted);
  }
  headerDirectory.setInt(GifHeaderDirectory.TAG_BITS_PER_PIXEL,bitsPerPixel);
  headerDirectory.setBoolean(GifHeaderDirectory.TAG_HAS_GLOBAL_COLOR_TABLE,hasGlobalColorTable);
  headerDirectory.setInt(GifHeaderDirectory.TAG_BACKGROUND_COLOR_INDEX,reader.getUInt8());
  int aspectRatioByte=reader.getUInt8();
  if (aspectRatioByte != 0) {
    float pixelAspectRatio=(float)((aspectRatioByte + 15d) / 64d);
    headerDirectory.setFloat(GifHeaderDirectory.TAG_PIXEL_ASPECT_RATIO,pixelAspectRatio);
  }
  return headerDirectory;
}