Skip to content

Commit 709e1c2

Browse files
funmancmassiot
authored andcommitted
arq examples: adds assertions
Incidentally gets rid of dead initialization warnings from clang
1 parent c7a383e commit 709e1c2

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

examples/arq_rx.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ static int catch_udp(struct uprobe *uprobe, struct upipe *upipe,
141141
} else {
142142
const struct sockaddr_in *in = (const struct sockaddr_in*) s;
143143
addr_len = sizeof(*in);
144+
assert(*len >= addr_len);
144145
memcpy(&addr, in, addr_len);
145146

146147
upipe_dbg_va(upipe, "GOT NEW REMOTE: %s:%hu ",

examples/arq_tx.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ int main(int argc, char *argv[])
323323
struct upipe *upipe_rtcp_sub = upipe_void_alloc_output_sub(upipe_probe_uref,
324324
upipe_rtcpfb,
325325
uprobe_pfx_alloc(uprobe_use(logger), loglevel, "rtcp fb sub"));
326+
assert(upipe_rtcp_sub);
326327

327328
struct upipe_mgr *dup_mgr = upipe_dup_mgr_alloc();
328329
struct upipe *dup = upipe_void_alloc_output(upipe_rtcpfb, dup_mgr,

0 commit comments

Comments
 (0)