[Kde-hardware-devel] Review Request 112603: Fix crash when XRandrOutput::currentMode() returns null pointer

Dan Vrátil dvratil at redhat.com
Mon Sep 9 13:08:29 UTC 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/112603/
-----------------------------------------------------------

Review request for Solid and Àlex Fiestas.


Description
-------

The assumption that XRandrOutput::currentMode() can never return a null pointer is wrong.

When currentMode() returns a null pointer it means, that there is no such mode in XRandROutput's cache that would match currentModeId. Obvious solution is to re-read modes from xrandr and hope, that xrandr internally have already added the mode and so after re-reading, currentModeId will be pointing to a valid mode cached in XRandROutput.

In case that even after re-reading modes there is still no mode with ID matching currentModeId, then the inconsistency comes from xrandr itself (or rather it's implementation in the driver) and so we choose the safe route and won't change the output at all and just leave it with it's current configuration.


This addresses bugs 323107 and 324625.
    http://bugs.kde.org/show_bug.cgi?id=323107
    http://bugs.kde.org/show_bug.cgi?id=324625


Diffs
-----

  backends/xrandr/xrandrconfig.cpp ff20c79 
  backends/xrandr/xrandrmode.h 005db6b 
  backends/xrandr/xrandrmode.cpp 0f465ab 
  backends/xrandr/xrandroutput.h a4eb5bf 
  backends/xrandr/xrandroutput.cpp 2750385 

Diff: http://git.reviewboard.kde.org/r/112603/diff/


Testing
-------

None, can't reproduce the crash.


Thanks,

Dan Vrátil

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-hardware-devel/attachments/20130909/4f428c70/attachment.html>


More information about the Kde-hardware-devel mailing list