Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 320498) +++ channels/chan_sip.c (working copy) @@ -4225,6 +4225,11 @@ int res = -1; struct sip_pvt *p = chan->tech_pvt; + if (!p) { + ast_log(LOG_ERROR, "Attempt to Ref a null pointer. sip private structure is gone!\n"); + return -1; + } + switch (option) { case AST_OPTION_FORMAT_READ: res = ast_rtp_instance_set_read_format(p->rtp, *(int *) data);