summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@nwnk.net>2005-11-18 18:02:24 +0000
committerAdam Jackson <ajax@nwnk.net>2005-11-18 18:02:24 +0000
commitde95d8ee197a0bb738037195997d754a20e10254 (patch)
tree64da96d5337824d4d540a0d0f6a2df5e004f64e1
parent21f7d03dbc347f6bf97a40671275ac75df15bd10 (diff)
Bug #4859: Don't segfault on bad DDC read. (Tony Houghton)
-rw-r--r--hw/xfree86/ddc/xf86DDC.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/hw/xfree86/ddc/xf86DDC.c b/hw/xfree86/ddc/xf86DDC.c
index f526cb484..36b214644 100644
--- a/hw/xfree86/ddc/xf86DDC.c
+++ b/hw/xfree86/ddc/xf86DDC.c
@@ -216,12 +216,15 @@ xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus)
#ifdef DEBUG
if (!tmp)
ErrorF("Cannot interpret EDID block\n");
- ErrorF("Sections to follow: %i\n",tmp->no_sections);
+ else
+ ErrorF("Sections to follow: %i\n",tmp->no_sections);
#endif
- VDIF_Block =
- VDIFRead(scrnIndex, pBus, EDID1_LEN * (tmp->no_sections + 1));
- tmp->vdif = xf86InterpretVdif(VDIF_Block);
-
+ if (tmp) {
+ VDIF_Block =
+ VDIFRead(scrnIndex, pBus, EDID1_LEN * (tmp->no_sections + 1));
+ tmp->vdif = xf86InterpretVdif(VDIF_Block);
+ }
+
return tmp;
}