From: Brian West Date: Mon, 22 Jun 2009 14:35:09 +0000 (+0000) Subject: mod_sndfile: fix off by one error (MODFORM-29) X-Git-Tag: v1.0.4~390 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d44d4076146292de2323c6d67d8f8f43185a9703;p=thirdparty%2Ffreeswitch.git mod_sndfile: fix off by one error (MODFORM-29) git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13890 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/mod/formats/mod_sndfile/mod_sndfile.c b/src/mod/formats/mod_sndfile/mod_sndfile.c index 3df7b8a8fa..1915932980 100644 --- a/src/mod/formats/mod_sndfile/mod_sndfile.c +++ b/src/mod/formats/mod_sndfile/mod_sndfile.c @@ -179,7 +179,7 @@ static switch_status_t sndfile_file_open(switch_file_handle_t *handle, const cha /* Try to find the file at the highest rate possible if we can't find one that matches the exact rate. If we don't find any, we will default back to the original file name. */ - for (i = 3; i > 0; i--) { + for (i = 3; i >= 0; i--) { switch_snprintf(last, alt_len - (last - alt_path), "%d%s%s", rates[i], SWITCH_PATH_SEPARATOR, ldup); if ((context->handle = sf_open(alt_path, mode, &context->sfinfo))) { path = alt_path;