only write when it make sense

This commit is contained in:
Seven Du 2013-09-25 20:02:39 +08:00
parent 9155e6b217
commit 135b1d70bb
1 changed files with 1 additions and 1 deletions

View File

@ -773,7 +773,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
switch_buffer_create_dynamic(&session->raw_read_buffer, bytes * SWITCH_BUFFER_BLOCK_FRAMES, bytes * SWITCH_BUFFER_START_FRAMES, 0);
}
if (!switch_buffer_write(session->raw_read_buffer, read_frame->data, read_frame->datalen)) {
if (read_frame->datalen && (!switch_buffer_write(session->raw_read_buffer, read_frame->data, read_frame->datalen))) {
status = SWITCH_STATUS_MEMERR;
goto done;
}