From 91f398bc302918969054d057c3a8cf8951eee408 Mon Sep 17 00:00:00 2001 From: Leandro Ribeiro Date: Tue, 16 Mar 2021 14:54:08 -0300 Subject: [PATCH] libweston: do not forget to check if test_data is NULL Since commit "libweston: add required_capabilities test suite quirk" a new function that depends on test_data is being called in wet_main(). We should check if test_data is NULL before calling it, otherwise we have a segfault when running outside the test suite. Signed-off-by: Leandro Ribeiro --- compositor/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compositor/main.c b/compositor/main.c index f673fa3a..7b8c196f 100644 --- a/compositor/main.c +++ b/compositor/main.c @@ -3382,7 +3382,7 @@ wet_main(int argc, char *argv[], const struct weston_testsuite_data *test_data) goto out; } - if (!check_compositor_capabilities(wet.compositor, + if (test_data && !check_compositor_capabilities(wet.compositor, test_data->test_quirks.required_capabilities)) { ret = WET_MAIN_RET_MISSING_CAPS; goto out;