Program: 100968
Project: 100968
Buggy source:
private void refresh(){
  if (!signalOn) {
    paintLogo();
    return;
  }
synchronized (refreshMonitor) {
    Graphics2D canvasGraphics=canvasGraphics();
    if (canvasGraphics == null)     return;
    int canvasEffectiveWidth=canvas.canvasEffectiveSize().width;
    int canvasEffectiveHeight=canvas.canvasEffectiveSize().height;
    if (crtMode >= 3 || (MULTI_BUFFERING < 2 && (osdFramesLeft >= 0 || crtMode > 0))) {
      int intermWidth=Math.min(canvasEffectiveWidth,2048);
      int intermHeight=Math.min(canvasEffectiveHeight,1280);
      Graphics2D intermGraphics=intermFrameImage.createGraphics();
      intermGraphics.setBackground(Color.BLACK);
      intermGraphics.clearRect(0,0,intermWidth,intermHeight);
      renderFrame(intermGraphics,intermWidth,intermHeight);
      if (crtMode == 2)       intermGraphics.drawImage(scanlinesTextureImage,0,0,intermWidth,intermHeight,0,0,intermWidth,intermHeight,null);
      if (crtMode >= 3) {
        intermGraphics.setComposite(crtTriadComposite);
        intermGraphics.drawImage(intermFrameImage,0,0,intermWidth,intermHeight,0,0,intermWidth,intermHeight,null);
      }
      intermGraphics.dispose();
      canvasGraphics.drawImage(intermFrameImage,0,0,intermWidth,intermHeight,0,0,intermWidth,intermHeight,null);
      paintOSD(canvasGraphics);
    }
 else {
      renderFrame(canvasGraphics,canvasEffectiveWidth,canvasEffectiveHeight);
      if (crtMode == 2)       canvasGraphics.drawImage(scanlinesTextureImage,0,0,canvasEffectiveWidth,canvasEffectiveHeight,0,0,canvasEffectiveWidth,canvasEffectiveHeight,null);
      paintOSD(canvasGraphics);
    }
    canvasFinish(canvasGraphics);
  }
}

Fixed version (ground truth):
private void refresh(){
  if (!signalOn) {
    paintLogo();
    return;
  }
synchronized (refreshMonitor) {
    Graphics2D canvasGraphics=canvasGraphics();
    if (canvasGraphics == null)     return;
    int canvasEffectiveWidth=canvas.canvasEffectiveSize().width;
    int canvasEffectiveHeight=canvas.canvasEffectiveSize().height;
    if (crtMode >= 3 || (MULTI_BUFFERING < 2 && (osdFramesLeft >= 0 || crtMode > 0))) {
      int intermWidth=Math.min(canvasEffectiveWidth,2048);
      int intermHeight=Math.min(canvasEffectiveHeight,1280);
      Graphics2D intermGraphics=intermFrameImage.createGraphics();
      intermGraphics.setBackground(Color.BLACK);
      intermGraphics.clearRect(0,0,intermWidth,intermHeight);
      renderFrame(intermGraphics,intermWidth,intermHeight);
      if (crtMode == 2)       intermGraphics.drawImage(scanlinesTextureImage,0,0,intermWidth,intermHeight,0,0,intermWidth,intermHeight,null);
      if (crtMode >= 3) {
        intermGraphics.setComposite(crtTriadComposite);
        intermGraphics.drawImage(intermFrameImage,0,0,intermWidth,intermHeight,0,0,intermWidth,intermHeight,null);
      }
      paintOSD(intermGraphics);
      intermGraphics.dispose();
      canvasGraphics.drawImage(intermFrameImage,0,0,intermWidth,intermHeight,0,0,intermWidth,intermHeight,null);
    }
 else {
      renderFrame(canvasGraphics,canvasEffectiveWidth,canvasEffectiveHeight);
      if (crtMode == 2) {
        canvasGraphics.setComposite(AlphaComposite.SrcOver);
        canvasGraphics.drawImage(scanlinesTextureImage,0,0,canvasEffectiveWidth,canvasEffectiveHeight,0,0,canvasEffectiveWidth,canvasEffectiveHeight,null);
      }
      paintOSD(canvasGraphics);
    }
    canvasFinish(canvasGraphics);
  }
}