gltestsrc: don't dereference null pointer

funcs can be NULL, it is one of the two conditions of the OR statement
above, so confirm it isn't before dereferencing with funcs->free.

CID 1358388
This commit is contained in:
Luis de Bethencourt 2016-04-12 11:14:22 +01:00 committed by Tim-Philipp Müller
parent 3ee2183038
commit 73110e6985

View file

@ -740,7 +740,7 @@ gst_gl_test_src_callback (gpointer stuff)
funcs = src->src_funcs; funcs = src->src_funcs;
if (!funcs || src->set_pattern != src->active_pattern) { if (!funcs || src->set_pattern != src->active_pattern) {
if (src->src_impl) if (src->src_impl && funcs)
funcs->free (src->src_impl); funcs->free (src->src_impl);
src->src_funcs = funcs = src->src_funcs = funcs =
gst_gl_test_src_get_src_funcs_for_pattern (src->set_pattern); gst_gl_test_src_get_src_funcs_for_pattern (src->set_pattern);