diff --git a/addons/chan_ooh323.c b/addons/chan_ooh323.c index bca7a8b96a..988778b313 100644 --- a/addons/chan_ooh323.c +++ b/addons/chan_ooh323.c @@ -4579,7 +4579,7 @@ struct ast_frame *ooh323_rtp_read(struct ast_channel *ast, struct ooh323_pvt *p) f = &null_frame; } - if (p->owner && !p->faxmode && (f->frametype == AST_FRAME_VOICE)) { + if (f && p->owner && !p->faxmode && (f->frametype == AST_FRAME_VOICE)) { /* We already hold the channel lock */ if (!(ast_format_cap_iscompatible(p->owner->nativeformats, &f->subclass.format))) { ast_debug(1, "Oooh, voice format changed to %s\n", ast_getformatname(&f->subclass.format)); diff --git a/channels/chan_h323.c b/channels/chan_h323.c index 23952b7db6..5f28720865 100644 --- a/channels/chan_h323.c +++ b/channels/chan_h323.c @@ -772,7 +772,7 @@ static struct ast_frame *oh323_rtp_read(struct oh323_pvt *pvt) if (f && (f->frametype == AST_FRAME_DTMF) && !(pvt->options.dtmfmode & (H323_DTMF_RFC2833 | H323_DTMF_CISCO))) { return &ast_null_frame; } - if (pvt->owner) { + if (f && pvt->owner) { /* We already hold the channel lock */ if (f->frametype == AST_FRAME_VOICE) { if (!ast_format_cap_iscompatible(pvt->owner->nativeformats, &f->subclass.format)) {