diff --git a/src/mod/endpoints/mod_rtmp/rtmp.c b/src/mod/endpoints/mod_rtmp/rtmp.c index 701487020e..25f769b552 100644 --- a/src/mod/endpoints/mod_rtmp/rtmp.c +++ b/src/mod/endpoints/mod_rtmp/rtmp.c @@ -886,6 +886,11 @@ switch_status_t rtmp_handle_data(rtmp_session_t *rsession) if (rsession->tech_pvt) { uint16_t len = state->origlen; + if (!rsession->tech_pvt->readbuf) { + return SWITCH_STATUS_FALSE; + } + + switch_mutex_lock(rsession->tech_pvt->readbuf_mutex); if (rsession->tech_pvt->maxlen && switch_buffer_inuse(rsession->tech_pvt->readbuf) > rsession->tech_pvt->maxlen * 40) { rsession->tech_pvt->over_size++;