diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-02-02 17:36:33 +0000 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-02-02 17:36:33 +0000 |
commit | f1872972ba633788b99fb8459562aaca6a4799f5 (patch) | |
tree | 57a6a5d8f36194727b8b7044fd1f67c6aee0d464 | |
parent | ca6af201c2625dd1219cb731fe33a76d767750a8 (diff) | |
download | xine-lib-f1872972ba633788b99fb8459562aaca6a4799f5.tar.gz xine-lib-f1872972ba633788b99fb8459562aaca6a4799f5.tar.bz2 |
Handle invalid port nos. properly (avoids a possible xcbxv segfault).
(Transplanted from 378582ca7b95e634cb0b04b714df0170b60688b3)
-rw-r--r-- | src/video_out/video_out_xcbxv.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/video_out/video_out_xcbxv.c b/src/video_out/video_out_xcbxv.c index efd3be3c2..49271b9c8 100644 --- a/src/video_out/video_out_xcbxv.c +++ b/src/video_out/video_out_xcbxv.c @@ -1102,6 +1102,8 @@ static int xv_check_yv12(xcb_connection_t *connection, xcb_xv_port_t port) { list_formats_cookie = xcb_xv_list_image_formats(connection, port); list_formats_reply = xcb_xv_list_image_formats_reply(connection, list_formats_cookie, NULL); + if (!list_formats_reply) + return 1; /* no formats listed; probably due to an invalid port no. */ format_it = xcb_xv_list_image_formats_format_iterator(list_formats_reply); for (; format_it.rem; xcb_xv_image_format_info_next(&format_it)) |