]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix out opf bounds err
authorBrian West <brian@freeswitch.org>
Thu, 10 Dec 2009 00:43:33 +0000 (00:43 +0000)
committerBrian West <brian@freeswitch.org>
Thu, 10 Dec 2009 00:43:33 +0000 (00:43 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15863 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_loadable_module.c

index 73e8f0fcffa84ed4e12a7a7548087d83212ec1a4..268b7ef7d558565bca9262dfad3ad3a63cc158af 100644 (file)
@@ -1437,7 +1437,7 @@ SWITCH_DECLARE(int) switch_loadable_module_get_codecs(const switch_codec_impleme
 
          found:
 
-               if (!lock) lock = array[i-1]->microseconds_per_packet;
+               if (!lock && i > 0) lock = array[i-1]->microseconds_per_packet;
 
                if (i > arraylen) {
                        break;
@@ -1534,7 +1534,7 @@ SWITCH_DECLARE(int) switch_loadable_module_get_codecs_sorted(const switch_codec_
 
                  found:
 
-                       if (!lock) {
+                       if (!lock && i > 0) {
                                lock = array[i-1]->microseconds_per_packet;
                        }