Skip to content

Commit

Permalink
MT#56447 fix list pointer check
Browse files Browse the repository at this point in the history
Check for EOL in the right places.

Change-Id: Ib9b9b1e08c585f3865a1c8ab0146b8a3eb3c7e39
Warned-by: Coverity
(cherry picked from commit 4e908d8)
  • Loading branch information
rfuchs committed Jun 22, 2023
1 parent 1437b37 commit b53fc3f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions daemon/call.c
Original file line number Diff line number Diff line change
Expand Up @@ -3491,17 +3491,20 @@ int monologue_subscribe_answer(struct call_monologue *dst_ml, struct sdp_ng_flag
bool transcoding = false;

for (GList *l = streams->head; l; l = l->next) {
if (!src_ml_it)
return -1;

struct stream_params *sp = l->data;

// grab the matching source ml:
// we need to move to the next one when we've reached the last media of
// the current source ml
if (src_media_it && !src_media_it->next) {
src_ml_it = src_ml_it->next;
if (!src_ml_it)
return -1;
index = 1; // starts over at 1
}
if (!src_ml_it)
return -1;

struct call_subscription *cs = src_ml_it->data;
struct call_monologue *src_ml = cs->monologue;
Expand Down

0 comments on commit b53fc3f

Please sign in to comment.