From f26c642055cafca18578054ae3178d05fcfbc562 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sat, 27 Mar 2021 19:23:34 +0100 Subject: [PATCH] loop: initialize some variables Just in case the read fails. --- spa/plugins/support/loop.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spa/plugins/support/loop.c b/spa/plugins/support/loop.c index 3daac9450..e9504ad9d 100644 --- a/spa/plugins/support/loop.c +++ b/spa/plugins/support/loop.c @@ -453,7 +453,7 @@ error_exit: static void source_event_func(struct spa_source *source) { struct source_impl *impl = SPA_CONTAINER_OF(source, struct source_impl, source); - uint64_t count; + uint64_t count = 0; int res; if ((res = spa_system_eventfd_read(impl->impl->system, source->fd, &count)) < 0) @@ -516,7 +516,7 @@ static int loop_signal_event(void *object, struct spa_source *source) static void source_timer_func(struct spa_source *source) { struct source_impl *impl = SPA_CONTAINER_OF(source, struct source_impl, source); - uint64_t expirations; + uint64_t expirations = 0; int res; if (SPA_UNLIKELY((res = spa_system_timerfd_read(impl->impl->system, @@ -596,7 +596,7 @@ loop_update_timer(void *object, struct spa_source *source, static void source_signal_func(struct spa_source *source) { struct source_impl *impl = SPA_CONTAINER_OF(source, struct source_impl, source); - int res, signal_number; + int res, signal_number = 0; if ((res = spa_system_signalfd_read(impl->impl->system, source->fd, &signal_number)) < 0) spa_log_warn(impl->impl->log, NAME " %p: failed to read signal fd %d: %s",