[haiku-commits] r42440 - haiku/trunk/src/add-ons/accelerants/common

  • From: axeld@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 16 Jul 2011 22:37:36 +0200 (CEST)

Author: axeld
Date: 2011-07-16 22:37:35 +0200 (Sat, 16 Jul 2011)
New Revision: 42440
Changeset: https://dev.haiku-os.org/changeset/42440

Modified:
   haiku/trunk/src/add-ons/accelerants/common/create_display_modes.cpp
Log:
* Don't crash if initialModes is NULL, but the count is not.


Modified: haiku/trunk/src/add-ons/accelerants/common/create_display_modes.cpp
===================================================================
--- haiku/trunk/src/add-ons/accelerants/common/create_display_modes.cpp 
2011-07-16 17:44:31 UTC (rev 42439)
+++ haiku/trunk/src/add-ons/accelerants/common/create_display_modes.cpp 
2011-07-16 20:37:35 UTC (rev 42440)
@@ -477,7 +477,8 @@
        // compile initial mode list from the different sources
 
        ModeList modes;
-       modes.AddModes(initialModes, initialModeCount);
+       if (initialModes != NULL)
+               modes.AddModes(initialModes, initialModeCount);
 
        if (edid != NULL)
                modes.AddModes(edid);


Other related posts:

  • » [haiku-commits] r42440 - haiku/trunk/src/add-ons/accelerants/common - axeld