summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2019-12-17 13:09:58 +0100
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2019-12-17 17:56:51 +0100
commitb55b0538c934df0fcabb5f9955a136ce9468494e (patch)
tree5ddc73d55c7a48747a53bc1e87318b404085d4a6
parent2cad0e56291c87f1b5e458c62a1e314f7cb2f8c9 (diff)
tests: check return calling of gst_navigation_event_parse.*
This issue was detected by Coverity. If the function returns an error value, the error value may be mistaken for a normal value. In cb_mouse_event: Value returned from a function is not checked for errors before being used
-rw-r--r--tests/check/elements/vaapipostproc.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/check/elements/vaapipostproc.c b/tests/check/elements/vaapipostproc.c
index 1e892d9a..e46304ff 100644
--- a/tests/check/elements/vaapipostproc.c
+++ b/tests/check/elements/vaapipostproc.c
@@ -125,18 +125,23 @@ static GstPadProbeReturn
cb_mouse_event (GstPad * pad, GstPadProbeInfo * info, gpointer data)
{
VppTestCoordinate *coord = data;
+ gdouble x = 0, y = 0;
GstEvent *event = GST_PAD_PROBE_INFO_EVENT (info);
if (GST_EVENT_TYPE (event) == GST_EVENT_NAVIGATION) {
switch (gst_navigation_event_get_type (event)) {
case GST_NAVIGATION_EVENT_MOUSE_MOVE:
- gst_navigation_event_parse_mouse_move_event (event, &coord->x,
- &coord->y);
+ if (gst_navigation_event_parse_mouse_move_event (event, &x, &y)) {
+ coord->x = x;
+ coord->y = y;
+ }
break;
case GST_NAVIGATION_EVENT_MOUSE_BUTTON_PRESS:
case GST_NAVIGATION_EVENT_MOUSE_BUTTON_RELEASE:
- gst_navigation_event_parse_mouse_button_event (event, NULL, &coord->x,
- &coord->y);
+ if (gst_navigation_event_parse_mouse_button_event (event, NULL, &x, &y)) {
+ coord->x = x;
+ coord->y = y;
+ }
break;
default:
break;
@@ -152,7 +157,7 @@ vpp_test_mouse_events (VppTestContext * ctx,
{
GstStructure *structure;
GstEvent *event;
- VppTestCoordinate probed;
+ VppTestCoordinate probed = { 0, };
guint i, j;
/* probe mouse events propagated up from vaapipostproc */