[PATCH] dri2: Set vdpau driver name if ddx does not provide any driver name
Adel Gadllah
adel.gadllah at gmail.com
Sat Jan 3 12:11:37 PST 2015
Am 03.01.2015 um 19:36 schrieb Alan Coopersmith:
> On 01/ 3/15 01:02 AM, Adel Gadllah wrote:
>> Currently when the ddx does not set any driver name we set DRI2 driver but
>> not the VDPAU driver name. The result is that VDPAU drivers will not get found
>> by libvdpau when the modesetting driver is being used.
>>
>> Just assume that the VDPAU driver matches the DRI2 driver name, this is true
>> for nouveau, r300, r600 and radeonsi i.e all VDPAU drivers currently supported
>> by mesa.
>>
>> Signed-off-by: Adel Gadllah <adel.gadllah at gmail.com>
>> ---
>> hw/xfree86/dri2/dri2.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
>> index c8fcd62..82e1f33 100644
>> --- a/hw/xfree86/dri2/dri2.c
>> +++ b/hw/xfree86/dri2/dri2.c
>> @@ -1581,7 +1581,8 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
>> if (info->driverName) {
>> ds->driverNames[0] = info->driverName;
>> } else {
>> - ds->driverNames[0] = dri2_probe_driver_name(pScreen, info);
>> + ds->numDrivers = 2;
>> + ds->driverNames[0] = ds->driverNames[1] = dri2_probe_driver_name(pScreen, info);
>
> Isn't that going to be a buffer overflow since memory was only allocated
> for one pointer, not two?
>
Oh good catch ... for some reason it did not crash while testing ... resending with that fixed.
More information about the xorg-devel
mailing list