From c9acaae37629654b12b0590adb2a69d7f1f5852e Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Fri, 24 Nov 2017 08:06:52 +0100 Subject: [PATCH] uvch264src: Check return values of all xu_query calls And use warnings/returns like for other calls CID #1373414 CID #1373417 --- sys/uvch264/gstuvch264_src.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/sys/uvch264/gstuvch264_src.c b/sys/uvch264/gstuvch264_src.c index 00bbad6..ed9dbe9 100644 --- a/sys/uvch264/gstuvch264_src.c +++ b/sys/uvch264/gstuvch264_src.c @@ -753,8 +753,9 @@ gst_uvc_h264_src_get_property (GObject * object, case PROP_LEAKY_BUCKET_SIZE: fill_probe_commit (self, &probe, 0, 0, 0, 0, 0); if (GST_STATE (self) >= GST_STATE_PAUSED) { - xu_query (self, UVCX_VIDEO_CONFIG_PROBE, UVC_GET_CUR, - (guchar *) & probe); + if (!xu_query (self, UVCX_VIDEO_CONFIG_PROBE, UVC_GET_CUR, + (guchar *) & probe)) + GST_WARNING_OBJECT (self, "probe_setting GET_CUR error"); } break; default: @@ -1323,7 +1324,11 @@ gst_uvc_h264_src_get_enum_setting (GstUvcH264Src * self, gchar * property, *default_value = def; *mask = 0; - xu_query (self, UVCX_RATE_CONTROL_MODE, UVC_GET_CUR, (guchar *) & cur); + if (!xu_query (self, UVCX_RATE_CONTROL_MODE, UVC_GET_CUR, + (guchar *) & cur)) { + GST_WARNING_OBJECT (self, " CONTROL_MODE GET_CUR error"); + return FALSE; + } for (en = min; en <= max; en++) { uvcx_rate_control_mode_t req = { 0, en }; @@ -1334,7 +1339,11 @@ gst_uvc_h264_src_get_enum_setting (GstUvcH264Src * self, gchar * property, (guchar *) & req) && req.bRateControlMode == en) *mask |= (1 << en); } - xu_query (self, UVCX_RATE_CONTROL_MODE, UVC_SET_CUR, (guchar *) & cur); + if (!xu_query (self, UVCX_RATE_CONTROL_MODE, UVC_SET_CUR, + (guchar *) & cur)) { + GST_WARNING_OBJECT (self, " CONTROL_MODE SET_CUR error"); + return FALSE; + } } } -- 2.7.4