@@ -5216,8 +5216,12 @@ static uint32_t rtp_packet_index(struct re_crypto_context *c,
5216
5216
spin_lock_irqsave (& c -> lock , flags );
5217
5217
5218
5218
/* rfc 3711 section 3.3.1 */
5219
- index = atomic_read (& ssrc_stats [ssrc_idx ]-> ext_seq );
5220
- if (unlikely (!index ))
5219
+ if (ssrc_stats [ssrc_idx ]) {
5220
+ index = atomic_read (& ssrc_stats [ssrc_idx ]-> ext_seq );
5221
+ if (unlikely (!index ))
5222
+ index = seq ;
5223
+ }
5224
+ else
5221
5225
index = seq ;
5222
5226
5223
5227
/* rfc 3711 appendix A, modified, and sections 3.3 and 3.3.1 */
@@ -5238,7 +5242,8 @@ static uint32_t rtp_packet_index(struct re_crypto_context *c,
5238
5242
}
5239
5243
5240
5244
index = (v << 16 ) | seq ;
5241
- atomic_set (& ssrc_stats [ssrc_idx ]-> ext_seq , index );
5245
+ if (ssrc_stats [ssrc_idx ])
5246
+ atomic_set (& ssrc_stats [ssrc_idx ]-> ext_seq , index );
5242
5247
5243
5248
spin_unlock_irqrestore (& c -> lock , flags );
5244
5249
@@ -5252,7 +5257,8 @@ static void update_packet_index(struct re_crypto_context *c,
5252
5257
if (ssrc_idx < 0 )
5253
5258
ssrc_idx = 0 ;
5254
5259
5255
- atomic_set (& ssrc_stats [ssrc_idx ]-> ext_seq , idx );
5260
+ if (ssrc_stats [ssrc_idx ])
5261
+ atomic_set (& ssrc_stats [ssrc_idx ]-> ext_seq , idx );
5256
5262
}
5257
5263
5258
5264
static int srtp_hash (unsigned char * hmac ,
@@ -6159,6 +6165,9 @@ static void rtp_stats(struct rtpengine_target *g, struct rtp_parsed *rtp, s64 ar
6159
6165
int32_t d ;
6160
6166
uint32_t new_seq ;
6161
6167
6168
+ if (!s )
6169
+ return ;
6170
+
6162
6171
uint16_t seq = ntohs (rtp -> rtp_header -> seq_num );
6163
6172
uint32_t ts = ntohl (rtp -> rtp_header -> timestamp );
6164
6173
@@ -6378,7 +6387,7 @@ static unsigned int rtpengine46(struct sk_buff *skb, struct sk_buff *oskb,
6378
6387
if (g -> target .pt_filter )
6379
6388
goto out ;
6380
6389
}
6381
- else if (ssrc_idx >= 0 ) {
6390
+ else if (ssrc_idx >= 0 && g -> target . ssrc_stats [ ssrc_idx ] ) {
6382
6391
atomic_set (& g -> target .ssrc_stats [ssrc_idx ]-> last_pt ,
6383
6392
g -> target .pt_stats [rtp_pt_idx ]-> payload_type );
6384
6393
atomic64_set (& g -> target .ssrc_stats [ssrc_idx ]-> last_packet , packet_ts );
0 commit comments