Commit 536628bb authored by Adam Jackson's avatar Adam Jackson 💣

Coverity #1037: Sanity check idx before use.

parent 53e97ce4
2006-04-06 Adam Jackson <ajax@freedesktop.org>
* hw/dmx/dmxextension.c:
Coverity #1037: Sanity check idx before use.
2006-04-06 Adam Jackson <ajax@freedesktop.org>
* Makefile.am:
......
......@@ -1062,8 +1062,8 @@ static Bool dmxCompareScreens(DMXScreenInfo *new, DMXScreenInfo *old)
/** Reattach previously detached back-end screen. */
int dmxAttachScreen(int idx, DMXScreenAttributesPtr attr)
{
ScreenPtr pScreen = screenInfo.screens[idx];
DMXScreenInfo *dmxScreen = &dmxScreens[idx];
ScreenPtr pScreen;
DMXScreenInfo *dmxScreen;
CARD32 scrnNum = idx;
DMXScreenInfo oldDMXScreen;
int i;
......@@ -1083,6 +1083,8 @@ int dmxAttachScreen(int idx, DMXScreenAttributesPtr attr)
/* Cannot add a screen that does not exist */
if (idx < 0 || idx >= dmxNumScreens) return 1;
pScreen = screenInfo.screens[idx];
dmxScreen = &dmxScreens[idx];
/* Cannot attach to a screen that is already opened */
if (dmxScreen->beDisplay) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment