[PATCH 02/10] kdrive: Xv code expects attribute names to be allocated each generation

Markus Wick markus at selfnet.de
Thu Mar 13 23:50:17 PDT 2014


Yeah, this fixes a crash in
"kdrive: Remove duplicated definitions of some XV-related structs.".
But as this patch was skipped in the megaseries, there is no need in 
only applying this fix.

Maybe squashing both patches together as the origin was a nice cleanup?

Am 2014-03-14 07:29, schrieb Keith Packard:
> Xv frees the attribute names for each X server generation; reset the
> server twice without allocating them  again and you get malloc
> complaints (or worse).
> 
> Signed-off-by: Keith Packard <keithp at keithp.com>
> ---
>  hw/kdrive/src/kxv.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c
> index 6f3d85e..f5b1e8a 100644
> --- a/hw/kdrive/src/kxv.c
> +++ b/hw/kdrive/src/kxv.c
> @@ -371,6 +371,7 @@ KdXVInitAdaptors(ScreenPtr pScreen,
> KdVideoAdaptorPtr * infoPtr, int number)
>              for (pat = pAttribute, attributePtr = 
> adaptorPtr->pAttributes, i =
>                   0; i < adaptorPtr->nAttributes; pat++, i++, 
> attributePtr++) {
>                  memcpy(pat, attributePtr, sizeof(*pat));
> +                pat->name = strdup(pAttribute->name);
>              }
>              pa->nAttributes = adaptorPtr->nAttributes;
>              pa->pAttributes = pAttribute;


More information about the xorg-devel mailing list