[vlc-commits] [Git][videolan/vlc][master] vdpau: fix segv when VDPAU uses VAAPI

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Wed Jan 19 15:22:48 UTC 2022



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
f850dd91 by Pierre Lamot at 2022-01-19T13:49:49+00:00
vdpau: fix segv when VDPAU uses VAAPI

The Close function was called with an uninitialized structure

- - - - -


1 changed file:

- modules/hw/vdpau/device.c


Changes:

=====================================
modules/hw/vdpau/device.c
=====================================
@@ -67,6 +67,8 @@ static int ScreenNumberOfWindow(Display *dpy, Window w)
 
 static int Open(vlc_decoder_device *device, vout_window_t *window)
 {
+    int errCode = VLC_EGENERIC;
+
     if (window == NULL || window->type != VOUT_WINDOW_TYPE_XID)
         return VLC_ENOTSUP;
     if (!vlc_xlib_init(VLC_OBJECT(device)))
@@ -98,8 +100,10 @@ static int Open(vlc_decoder_device *device, vout_window_t *window)
     {
         if (strstr(infos, "VAAPI") != NULL)
         {
-            Close(device);
-            return -EACCES;
+            vdp_device_destroy(vi->device.vdp, vi->device.device);
+            vdp_destroy_x11(vi->device.vdp);
+            errCode = -EACCES;
+            goto error;
         }
 
         msg_Info(device, "Using %s", infos);
@@ -114,7 +118,7 @@ static int Open(vlc_decoder_device *device, vout_window_t *window)
 error:
     XCloseDisplay(vi->display);
     free(vi);
-    return VLC_EGENERIC;
+    return errCode;
 }
 
 vlc_module_begin()



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/f850dd91554acc829dd0160e69382dfaa701f991

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/f850dd91554acc829dd0160e69382dfaa701f991
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list