[svn-commits] file: trunk r101223 - in /trunk: ./ main/slinfactory.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Jan 30 09:42:29 CST 2008


Author: file
Date: Wed Jan 30 09:42:29 2008
New Revision: 101223

URL: http://svn.digium.com/view/asterisk?view=rev&rev=101223
Log:
Merged revisions 101222 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r101222 | file | 2008-01-30 11:41:04 -0400 (Wed, 30 Jan 2008) | 4 lines

Fix an issue where if a frame of higher sample size preceeded a frame of lower sample size and ast_slinfactory_read was called with a sample size of the combined values or higher a crash would happen.
(closes issue #11878)
Reported by: stuarth

........

Modified:
    trunk/   (props changed)
    trunk/main/slinfactory.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/main/slinfactory.c
URL: http://svn.digium.com/view/asterisk/trunk/main/slinfactory.c?view=diff&rev=101223&r1=101222&r2=101223
==============================================================================
--- trunk/main/slinfactory.c (original)
+++ trunk/main/slinfactory.c Wed Jan 30 09:42:29 2008
@@ -109,7 +109,7 @@
 		ineed = samples - sofar;
 
 		if (sf->holdlen) {
-			if ((sofar + sf->holdlen) <= ineed) {
+			if (sf->holdlen <= ineed) {
 				memcpy(offset, sf->hold, sf->holdlen * sizeof(*offset));
 				sofar += sf->holdlen;
 				offset += sf->holdlen;
@@ -128,7 +128,7 @@
 		if ((frame_ptr = AST_LIST_REMOVE_HEAD(&sf->queue, frame_list))) {
 			frame_data = frame_ptr->data;
 			
-			if ((sofar + frame_ptr->samples) <= ineed) {
+			if (frame_ptr->samples <= ineed) {
 				memcpy(offset, frame_data, frame_ptr->samples * sizeof(*offset));
 				sofar += frame_ptr->samples;
 				offset += frame_ptr->samples;




More information about the svn-commits mailing list