From f1872972ba633788b99fb8459562aaca6a4799f5 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sat, 2 Feb 2008 17:36:33 +0000 Subject: Handle invalid port nos. properly (avoids a possible xcbxv segfault). (Transplanted from 378582ca7b95e634cb0b04b714df0170b60688b3) --- src/video_out/video_out_xcbxv.c | 2 ++ 1 file changed, 2 insertions(+) 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)) -- cgit v1.2.3