Program: 56093
Project: 56093
Buggy source:
/** 
 * Gets the geometry of the background as array.
 * @param boundbuffer The buffer of opengl.
 * @param context The context to use.
 * @return The geometry as float array.
 */
private void reloadGeometry(GLBuffer boundbuffer,MapRectangle area,MapDrawContext context){
  boolean hasInvalidFields=!geometryInvalid.isEmpty();
  int width=context.getMap().getWidth();
  int height=context.getMap().getHeight();
  int oldbuffertop=0;
  int oldbufferbottom=0;
  if (oldBufferPosition != null) {
    oldbuffertop=oldBufferPosition.getLineY(0);
    oldbufferbottom=oldbuffertop + bufferheight;
  }
  for (int line=0; line < bufferheight; line++) {
    int y=area.getLineY(line);
    int minx=area.getLineStartX(line);
    int maxx=minx + bufferwidth;
    int oldminx=0;
    int oldmaxx=0;
    if (y >= oldbuffertop && y < oldbufferbottom) {
      oldminx=oldBufferPosition.getLineStartX(y - oldbuffertop);
      oldmaxx=oldminx + bufferwidth;
    }
    boolean lineIsInMap=y >= 0 && y < height;
    for (int x=minx; x < maxx; x++) {
      int bufferPosition=getBufferPosition(y,x);
      if (oldminx > x || oldmaxx <= x) {
        redrawPoint(boundbuffer,context,x,y,false,bufferPosition);
      }
 else       if (lineIsInMap && x >= 0 && x < width) {
        if (hasInvalidFields) {
          boolean invalid=false;
synchronized (this) {
            invalid=geometryInvalid.get(bufferPosition);
            geometryInvalid.clear(bufferPosition);
          }
          if (invalid) {
            redrawPoint(boundbuffer,context,x,y,true,bufferPosition);
          }
        }
 else         if (context.getVisibleStatus(x,y) != fogOfWarStatus[bufferPosition * 4]) {
          redrawPoint(boundbuffer,context,x,y,true,bufferPosition);
          invalidatePoint(x - 1,y);
          invalidatePoint(x - 1,y - 1);
          invalidatePoint(x - 1,y - 1);
        }
      }
    }
  }
  oldBufferPosition=area;
}

Fixed version (ground truth):
/** 
 * Gets the geometry of the background as array.
 * @param boundbuffer The buffer of opengl.
 * @param context The context to use.
 * @return The geometry as float array.
 */
private void reloadGeometry(GLBuffer boundbuffer,MapRectangle area,MapDrawContext context){
  boolean hasInvalidFields=!geometryInvalid.isEmpty();
  int width=context.getMap().getWidth();
  int height=context.getMap().getHeight();
  int oldbuffertop=oldBufferPosition.getLineY(0);
  int oldbufferbottom=oldbuffertop + bufferheight;
  for (int line=0; line < bufferheight; line++) {
    int y=area.getLineY(line);
    int minx=area.getLineStartX(line);
    int maxx=minx + bufferwidth;
    int oldminx=0;
    int oldmaxx=0;
    if (y >= oldbuffertop && y < oldbufferbottom) {
      oldminx=oldBufferPosition.getLineStartX(y - oldbuffertop);
      oldmaxx=oldminx + bufferwidth;
    }
    boolean lineIsInMap=y >= 0 && y < height;
    for (int x=minx; x < maxx; x++) {
      int bufferPosition=getBufferPosition(y,x);
      if (oldminx > x || oldmaxx <= x) {
        redrawPoint(boundbuffer,context,x,y,false,bufferPosition);
      }
 else       if (lineIsInMap && x >= 0 && x < width) {
        if (hasInvalidFields) {
          boolean invalid=false;
synchronized (this) {
            invalid=geometryInvalid.get(bufferPosition);
            geometryInvalid.clear(bufferPosition);
          }
          if (invalid) {
            redrawPoint(boundbuffer,context,x,y,true,bufferPosition);
          }
        }
 else         if (context.getVisibleStatus(x,y) != fogOfWarStatus[bufferPosition * 4]) {
          redrawPoint(boundbuffer,context,x,y,true,bufferPosition);
          invalidatePoint(x - 1,y);
          invalidatePoint(x - 1,y - 1);
          invalidatePoint(x - 1,y - 1);
        }
      }
    }
  }
  oldBufferPosition=area;
}