[asterisk-commits] file: branch group/media_formats r407181 - /team/group/media_formats/include/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Feb 3 07:54:12 CST 2014


Author: file
Date: Mon Feb  3 07:54:09 2014
New Revision: 407181

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=407181
Log:
Fix a bug where the max on a vector insertion would be smaller than needed.

Modified:
    team/group/media_formats/include/asterisk/vector.h

Modified: team/group/media_formats/include/asterisk/vector.h
URL: http://svnview.digium.com/svn/asterisk/team/group/media_formats/include/asterisk/vector.h?view=diff&rev=407181&r1=407180&r2=407181
==============================================================================
--- team/group/media_formats/include/asterisk/vector.h (original)
+++ team/group/media_formats/include/asterisk/vector.h Mon Feb  3 07:54:09 2014
@@ -129,7 +129,7 @@
  	int res = 0;												\
  	do {														\
  		if ((idx + 1) > (vec)->max) {							\
- 			size_t new_max = (vec)->max ? 2 * (vec)->max : 1;	\
+ 			size_t new_max = (idx + 1) * 2;						\
 			typeof((vec)->elems) new_elems = ast_realloc(		\
 				(vec)->elems, new_max * sizeof(*new_elems));	\
 			if (new_elems) {									\




More information about the asterisk-commits mailing list