[asterisk-commits] jrose: branch 1.8 r389895 - /branches/1.8/main/slinfactory.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue May 28 12:35:16 CDT 2013


Author: jrose
Date: Tue May 28 12:35:12 2013
New Revision: 389895

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=389895
Log:
Fix a memory copying bug in slinfactory which was causing mixmonitor issues.

Reported by: Michael Walton
Tested by: Jonathan Rose
Patches:
    slinfactory.c.ASTERISK-21799.patch uploaded by Michael Walton (license 6502)

Modified:
    branches/1.8/main/slinfactory.c

Modified: branches/1.8/main/slinfactory.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/slinfactory.c?view=diff&rev=389895&r1=389894&r2=389895
==============================================================================
--- branches/1.8/main/slinfactory.c (original)
+++ branches/1.8/main/slinfactory.c Tue May 28 12:35:12 2013
@@ -139,7 +139,7 @@
 	return x;
 }
 
-int ast_slinfactory_read(struct ast_slinfactory *sf, short *buf, size_t samples) 
+int ast_slinfactory_read(struct ast_slinfactory *sf, short *buf, size_t samples)
 {
 	struct ast_frame *frame_ptr;
 	unsigned int sofar = 0, ineed, remain;
@@ -150,7 +150,7 @@
 
 		if (sf->holdlen) {
 			if (sf->holdlen <= ineed) {
-				memcpy(offset, sf->hold, sf->holdlen * sizeof(*offset));
+				memcpy(offset, sf->offset, sf->holdlen * sizeof(*offset));
 				sofar += sf->holdlen;
 				offset += sf->holdlen;
 				sf->holdlen = 0;
@@ -164,10 +164,10 @@
 			}
 			continue;
 		}
-		
+
 		if ((frame_ptr = AST_LIST_REMOVE_HEAD(&sf->queue, frame_list))) {
 			frame_data = frame_ptr->data.ptr;
-			
+
 			if (frame_ptr->samples <= ineed) {
 				memcpy(offset, frame_data, frame_ptr->samples * sizeof(*offset));
 				sofar += frame_ptr->samples;




More information about the asterisk-commits mailing list