[PATCH xf86-video-nested 2/3] Fix segmentation fault when no modes specified

Daniel Martin consume.noise at gmail.com
Wed Jul 11 15:29:43 PDT 2012


The test if a mode was specified in the Display SubSection was wrong.
... pScrn->display->modes vs. pScrn->display->modes[0]
---
 src/driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/driver.c b/src/driver.c
index b38e492..2cae14e 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -423,7 +423,7 @@ NestedValidateModes(ScrnInfoPtr pScrn) {
     xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Too bad for it...\n");
 
     /* If user requested modes, add them. If not, use 640x480 */
-    if (pScrn->display->modes != NULL) {
+    if (pScrn->display->modes[0] != NULL) {
         xf86DrvMsg(pScrn->scrnIndex, X_INFO, "User wants these modes:\n");
         for(i = 0; pScrn->display->modes[i] != NULL; i++) {
             xf86DrvMsg(pScrn->scrnIndex, X_INFO, "  %s\n",
-- 
1.7.11.1



More information about the xorg-devel mailing list