[Pkg-voip-commits] [janus] 53/163: Fixed some typos, leaks, and broken checks

Jonas Smedegaard dr at jones.dk
Sat Oct 28 01:22:09 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag debian/0.2.5-1
in repository janus.

commit 05b5a81429219c4e6496eeb7261f2e592e87209c
Author: Lorenzo Miniero <lminiero at gmail.com>
Date:   Tue Aug 1 13:18:15 2017 +0200

    Fixed some typos, leaks, and broken checks
---
 ice.c                     |  2 +-
 plugins/janus_streaming.c | 10 +++++-----
 plugins/janus_videocall.c |  2 +-
 plugins/janus_videoroom.c |  2 +-
 utils.c                   |  6 ++++--
 5 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/ice.c b/ice.c
index 9a71a34..f6d68c4 100644
--- a/ice.c
+++ b/ice.c
@@ -2275,7 +2275,7 @@ static void janus_ice_cb_nice_recv(NiceAgent *agent, guint stream_id, guint comp
 							} else {
 								/* If we're simulcasting, let's compare to the other SSRCs too */
 								if((stream->video_ssrc_peer_sim_1 && rtcp_ssrc == stream->video_ssrc_peer_sim_1) ||
-										(stream->video_ssrc_peer_sim_1 && rtcp_ssrc == stream->video_ssrc_peer_sim_1)) {
+										(stream->video_ssrc_peer_sim_2 && rtcp_ssrc == stream->video_ssrc_peer_sim_2)) {
 									/* FIXME RTCP for simulcasting SSRC, let's drop it for now... */
 									JANUS_LOG(LOG_HUGE, "Dropping RTCP packet for SSRC %"SCNu32"\n", rtcp_ssrc);
 									return;
diff --git a/plugins/janus_streaming.c b/plugins/janus_streaming.c
index 8714c6e..2ac88ed 100644
--- a/plugins/janus_streaming.c
+++ b/plugins/janus_streaming.c
@@ -3147,9 +3147,9 @@ janus_streaming_mountpoint *janus_streaming_create_rtp_source(
 					"Video", "video", name ? name : tempname);
 				if(video_fd[1] < 0) {
 					JANUS_LOG(LOG_ERR, "Can't bind to port %d for video (2nd port)...\n", vport2);
-					if(audio_fd > 0)
+					if(audio_fd > -1)
 						close(audio_fd);
-					if(video_fd[0] > 0)
+					if(video_fd[0] > -1)
 						close(video_fd[0]);
 					janus_mutex_unlock(&mountpoints_mutex);
 					return NULL;
@@ -3160,11 +3160,11 @@ janus_streaming_mountpoint *janus_streaming_create_rtp_source(
 					"Video", "video", name ? name : tempname);
 				if(video_fd[2] < 0) {
 					JANUS_LOG(LOG_ERR, "Can't bind to port %d for video (3rd port)...\n", vport3);
-					if(audio_fd > 0)
+					if(audio_fd > -1)
 						close(audio_fd);
-					if(video_fd[0] > 0)
+					if(video_fd[0] > -1)
 						close(video_fd[0]);
-					if(video_fd[1] > 0)
+					if(video_fd[1] > -1)
 						close(video_fd[1]);
 					janus_mutex_unlock(&mountpoints_mutex);
 					return NULL;
diff --git a/plugins/janus_videocall.c b/plugins/janus_videocall.c
index 34a691a..53890af 100644
--- a/plugins/janus_videocall.c
+++ b/plugins/janus_videocall.c
@@ -635,7 +635,7 @@ json_t *janus_videocall_query_session(janus_plugin_session *handle) {
 	if(session->ssrc[0] != 0) {
 		json_object_set_new(info, "simulcast", json_true());
 	}
-	if(session->peer->ssrc[0] != 0) {
+	if(session->peer && session->peer->ssrc[0] != 0) {
 		json_object_set_new(info, "simulcast-peer", json_true());
 		json_object_set_new(info, "substream", json_integer(session->substream));
 		json_object_set_new(info, "substream-target", json_integer(session->substream_target));
diff --git a/plugins/janus_videoroom.c b/plugins/janus_videoroom.c
index 3495cb9..80459c8 100644
--- a/plugins/janus_videoroom.c
+++ b/plugins/janus_videoroom.c
@@ -1237,7 +1237,7 @@ json_t *janus_videoroom_query_session(janus_plugin_session *handle) {
 				json_object_set_new(media, "audio", json_integer(participant->audio_offered));
 				json_object_set_new(media, "video", json_integer(participant->video_offered));
 				json_object_set_new(media, "data", json_integer(participant->data_offered));
-				if(feed->ssrc[0] != 0) {
+				if(feed && feed->ssrc[0] != 0) {
 					json_object_set_new(info, "simulcast", json_true());
 					json_object_set_new(info, "substream", json_integer(participant->substream));
 					json_object_set_new(info, "substream-target", json_integer(participant->substream_target));
diff --git a/utils.c b/utils.c
index d8bffbd..73c8baa 100644
--- a/utils.c
+++ b/utils.c
@@ -639,8 +639,10 @@ gboolean janus_vp9_is_keyframe(char* buffer, int len) {
 				uint16_t *h = (uint16_t *)buffer;
 				int vp9h = ntohs(*h);
 				buffer += 2;
-				JANUS_LOG(LOG_WARN, "Got a VP9 key frame: %dx%d\n", vp9w, vp9h);
-				return TRUE;
+				if(vp9w || vp9h) {
+					JANUS_LOG(LOG_WARN, "Got a VP9 key frame: %dx%d\n", vp9w, vp9h);
+					return TRUE;
+				}
 			}
 		}
 	}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/janus.git



More information about the Pkg-voip-commits mailing list