title: EXCEPTION_ACCESS_VIOLATION crash in ig9icd64.dll when blitting to the window
body: <p>When I render to an FBO and blit this FBO to the window and the window is minimized Java throws an EXCEPTION_ACCESS_VIOLATION exception.</p>
  <p>This is my code for blitting to the screen and to my understanding, what it does.</p>
  <pre><code>//Bind the draw framebuffer to the default (0) 
  GL30.glBindFramebuffer(GL30.GL_DRAW_FRAMEBUFFER, 0); 
  //Bind the read framebuffer to the fbo id
  GL30.glBindFramebuffer(GL30.GL_READ_FRAMEBUFFER, frameBufferID); 
  //Setting the draw buffer to the screen
  GL11.glDrawBuffer(GL11.GL_BACK); 
  //Settiing the read buffer to the color attachment of the fbo
  GL11.glReadBuffer(GL30.GL_COLOR_ATTACHMENT0);
  if(GL30.glCheckFramebufferStatus(GL30.GL_FRAMEBUFFER) == GL30.GL_FRAMEBUFFER_COMPLETE) //Checking if the framebuffer is complete
  { 
    //Blitting the frambuffer to the screen
    GL30.glBlitFramebuffer(0, 0, fboWidth, fboHeight, 0, 0, windowWidth, windowHeight, GL11.GL_COLOR_BUFFER_BIT, GL11.GL_NEAREST); 
  }
  //Unbinding the framebuffer
  GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, 0); 
  </code></pre>
  <p>To prevent the crash I added a check to check if the window is minimized</p>
  <pre><code>if(isWindowIconified) return;
  //Bind the draw framebuffer to the default (0) 
  GL30.glBindFramebuffer(GL30.GL_DRAW_FRAMEBUFFER, 0); 
  //Bind the read framebuffer to the fbo
  GL30.glBindFramebuffer(GL30.GL_READ_FRAMEBUFFER, frameBufferID); 
  //Setting the draw buffer to the screen
  GL11.glDrawBuffer(GL11.GL_BACK);
  //Settiing the read buffer to the color attachment of the fbo
  GL11.glReadBuffer(GL30.GL_COLOR_ATTACHMENT0); 
  if(GL30.glCheckFramebufferStatus(GL30.GL_FRAMEBUFFER) == GL30.GL_FRAMEBUFFER_COMPLETE)
  { 
    //Blitting the frambuffer to the screen
    GL30.glBlitFramebuffer(0, 0, fboWidth, fboHeight, 0, 0, windowWidth, windowHeight, GL11.GL_COLOR_BUFFER_BIT, GL11.GL_NEAREST); 
  }
  //Unbinding the framebuffer
  GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, 0);
  </code></pre>
  <p>I also added this bit of code when initializing the window</p>
  <pre><code>//Setting the window minimisazion callback
  glfwSetWindowIconifyCallback(window, new GLFWWindowIconifyCallbackI() { 
    @Override
    public void invoke(long window, boolean iconified) {
      isWindowIconified = iconified;
    }
  });
  </code></pre>
  <p>Now the program doesn't crash when I minimize it, but when I press Windows+D to get to the desktop the program still crashes.</p>
  <p>Now to my questions:
  What is the best way to prevent the crash?
  Why does this happen?</p>
  <p><a href="https://pastebin.com/i6xiWdKi" rel="nofollow noreferrer">Crash Report</a></p>
  <p>System Information:</p>
  <p>OS: Windows 10 Home, Version 10.0.15063</p>
  <p>GPU: Intel HD Graphics 520</p>
  <p>Driver Version: 20.19.15.4642</p>
  <p>OpenGL Version: 4.4</p>