From 7785c310a9bb4e37c56263504a4b5df99685e49f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Sun, 10 Jan 2021 11:04:19 +0100 Subject: [PATCH] Fix some Uninitialized Memory --- gui/src/streamsession.cpp | 3 ++- lib/src/frameprocessor.c | 2 ++ lib/src/senkusha.c | 2 +- lib/src/videoreceiver.c | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gui/src/streamsession.cpp b/gui/src/streamsession.cpp index 7d25136..3f46070 100644 --- a/gui/src/streamsession.cpp +++ b/gui/src/streamsession.cpp @@ -102,11 +102,12 @@ StreamSession::StreamSession(const StreamSessionConnectInfo &connect_info, QObje QByteArray host_str = connect_info.host.toUtf8(); - ChiakiConnectInfo chiaki_connect_info; + ChiakiConnectInfo chiaki_connect_info = {}; chiaki_connect_info.ps5 = chiaki_target_is_ps5(connect_info.target); chiaki_connect_info.host = host_str.constData(); chiaki_connect_info.video_profile = connect_info.video_profile; chiaki_connect_info.video_profile_auto_downgrade = true; + chiaki_connect_info.enable_keyboard = false; #if CHIAKI_LIB_ENABLE_PI_DECODER if(connect_info.decoder == Decoder::Pi && chiaki_connect_info.video_profile.codec != CHIAKI_CODEC_H264) diff --git a/lib/src/frameprocessor.c b/lib/src/frameprocessor.c index c072a98..bcee36b 100644 --- a/lib/src/frameprocessor.c +++ b/lib/src/frameprocessor.c @@ -48,6 +48,8 @@ CHIAKI_EXPORT void chiaki_frame_processor_init(ChiakiFrameProcessor *frame_proce frame_processor->buf_stride_per_unit = 0; frame_processor->units_source_expected = 0; frame_processor->units_fec_expected = 0; + frame_processor->units_source_received = 0; + frame_processor->units_fec_received = 0; frame_processor->unit_slots = NULL; frame_processor->unit_slots_size = 0; frame_processor->flushed = true; diff --git a/lib/src/senkusha.c b/lib/src/senkusha.c index ebab5d7..fc4e600 100644 --- a/lib/src/senkusha.c +++ b/lib/src/senkusha.c @@ -361,7 +361,7 @@ static ChiakiErrorCode senkusha_run_mtu_in_test(ChiakiSenkusha *senkusha, uint32 senkusha->state_failed = false; senkusha->mtu_id = ++request_id; - tkproto_SenkushaMtuCommand mtu_cmd; + tkproto_SenkushaMtuCommand mtu_cmd = { 0 }; mtu_cmd.id = request_id; mtu_cmd.mtu_req = cur; mtu_cmd.num = 1; diff --git a/lib/src/videoreceiver.c b/lib/src/videoreceiver.c index 52beb02..6468fcd 100644 --- a/lib/src/videoreceiver.c +++ b/lib/src/videoreceiver.c @@ -17,6 +17,7 @@ CHIAKI_EXPORT void chiaki_video_receiver_init(ChiakiVideoReceiver *video_receive video_receiver->frame_index_cur = -1; video_receiver->frame_index_prev = -1; + video_receiver->frame_index_prev_complete = 0; chiaki_frame_processor_init(&video_receiver->frame_processor, video_receiver->log); video_receiver->packet_stats = packet_stats;