VirtualBox

Changeset 49603 in vbox


Ignore:
Timestamp:
Nov 21, 2013 2:45:47 PM (11 years ago)
Author:
vboxsync
Message:

DevVGA,DisplayImpl: prevent access to invalid framebuffer.

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r49507 r49603  
    18341834                fgcol = palette[cattr & 0x0f];
    18351835                if (cw != 9) {
    1836                     vga_draw_glyph8(d1, linesize,
    1837                                     font_ptr, cheight, fgcol, bgcol, dscan);
     1836                    if (pThis->fRenderVRAM)
     1837                        vga_draw_glyph8(d1, linesize,
     1838                                        font_ptr, cheight, fgcol, bgcol, dscan);
    18381839                } else {
    18391840                    dup9 = 0;
    18401841                    if (ch >= 0xb0 && ch <= 0xdf && (pThis->ar[0x10] & 0x04))
    18411842                        dup9 = 1;
    1842                     vga_draw_glyph9(d1, linesize,
    1843                                     font_ptr, cheight, fgcol, bgcol, dup9);
     1843                    if (pThis->fRenderVRAM)
     1844                        vga_draw_glyph9(d1, linesize,
     1845                                        font_ptr, cheight, fgcol, bgcol, dup9);
    18441846                }
    18451847                if (src == cursor_ptr &&
     
    18561858                        d = d1 + (linesize * line_start << dscan);
    18571859                        if (cw != 9) {
    1858                             vga_draw_glyph8(d, linesize,
    1859                                             cursor_glyph, h, fgcol, bgcol, dscan);
     1860                            if (pThis->fRenderVRAM)
     1861                                vga_draw_glyph8(d, linesize,
     1862                                                cursor_glyph, h, fgcol, bgcol, dscan);
    18601863                        } else {
    1861                             vga_draw_glyph9(d, linesize,
    1862                                             cursor_glyph, h, fgcol, bgcol, 1);
     1864                            if (pThis->fRenderVRAM)
     1865                                vga_draw_glyph9(d, linesize,
     1866                                                cursor_glyph, h, fgcol, bgcol, 1);
    18631867                        }
    18641868                    }
     
    49464950    LogFlow(("vgaPortSetRenderVRAM: fRender = %d\n", fRender));
    49474951
     4952    int rc = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
     4953    AssertRC(rc);
     4954
    49484955    pThis->fRenderVRAM = fRender;
     4956
     4957    PDMCritSectLeave(&pThis->CritSect);
    49494958}
    49504959
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r49474 r49603  
    679679    }
    680680
    681     mLastAddress = pvVRAM;
    682     mLastBytesPerLine = cbLine;
    683     mLastBitsPerPixel = bpp;
    684     mLastWidth = w;
    685     mLastHeight = h;
    686     mLastFlags = flags;
     681    if (uScreenId == VBOX_VIDEO_PRIMARY_SCREEN)
     682    {
     683        mLastAddress = pvVRAM;
     684        mLastBytesPerLine = cbLine;
     685        mLastBitsPerPixel = bpp;
     686        mLastWidth = w;
     687        mLastHeight = h;
     688        mLastFlags = flags;
     689    }
    687690
    688691    ULONG pixelFormat;
     
    729732        return VINF_VGA_RESIZE_IN_PROGRESS;
    730733    }
     734
     735    /* Framebuffer will be invalid during resize, make sure that it is not accessed. */
     736    if (uScreenId == VBOX_VIDEO_PRIMARY_SCREEN)
     737        mpDrv->pUpPort->pfnSetRenderVRAM (mpDrv->pUpPort, false);
    731738
    732739    int rc = callFramebufferResize (maFramebuffers[uScreenId].pFramebuffer, uScreenId,
     
    794801        }
    795802
     803        /* Inform VRDP server about the change of display parameters.
     804         * Must be done before calling NotifyUpdate below.
     805         */
     806        LogRelFlowFunc(("Calling VRDP\n"));
     807        mParent->consoleVRDPServer()->SendResize();
     808
    796809        /* @todo Merge these two 'if's within one 'if (!pFBInfo->pFramebuffer.isNull())' */
    797810        if (uScreenId == VBOX_VIDEO_PRIMARY_SCREEN && !pFBInfo->pFramebuffer.isNull())
     
    864877        }
    865878#endif /* DEBUG_sunlover */
    866 
    867         /* Inform VRDP server about the change of display parameters. */
    868         LogRelFlowFunc(("Calling VRDP\n"));
    869         mParent->consoleVRDPServer()->SendResize();
    870879
    871880#if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette