[PATCH] fix xserver crash when configuring TV Out on intel driver

Eric Anholt eric at anholt.net
Wed Oct 24 11:08:12 PDT 2007


On Wed, 2007-10-24 at 21:15 +1000, rglowery at exemail.com.au wrote:
> I believe I have found the cause of the xserver crash when running "xrandr
> --output TV --set TV_FORMAT 576p --auto" while no other output devices are
> connected.
> 
> The issue is that i830_tv_get_modes() is leaving the DisplayModeRec prev
> pointer uninitialised which is confusing xf86DeleteMode()
> 
> Patch below appears to fix the problem, however looking at the comments in
> xf86DeleteMode(), it is supposed to support a singly linked list, but the
> implementation obviously does not.
> 
> diff --git a/src/i830_tv.c b/src/i830_tv.c
> index 940250e..d96a501 100644
> --- a/src/i830_tv.c
> +++ b/src/i830_tv.c
> @@ -1451,6 +1451,9 @@ i830_tv_get_modes(xf86OutputPtr output)
> 
>         mode_ptr->type = M_T_DRIVER;
>         mode_ptr->next = ret;
> +       mode_ptr->prev = NULL;
> +       if (ret)
> +           ret->prev = mode_ptr;
>         ret = mode_ptr;
>      }

Committed.  Thanks!

Yeah, xf86DeleteMode works for all those types of lists, but only as
long as all the fields are initialized :)

-- 
Eric Anholt                             anholt at FreeBSD.org
eric at anholt.net                         eric.anholt at intel.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg/attachments/20071024/efd7d9e3/attachment.pgp>


More information about the xorg mailing list