From: Seven Du Date: Wed, 25 Sep 2013 12:02:39 +0000 (+0800) Subject: only write when it make sense X-Git-Tag: v1.5.8~75^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=135b1d70bbbe8deb4d9a73f4ca84b2e1972b11e1;p=thirdparty%2Ffreeswitch.git only write when it make sense --- diff --git a/src/switch_core_io.c b/src/switch_core_io.c index 2b3c3b6d66..aad6192ece 100644 --- a/src/switch_core_io.c +++ b/src/switch_core_io.c @@ -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; }