[svn-commits] mjordan: branch 1.8 r362304 - /branches/1.8/formats/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Apr 17 13:25:48 CDT 2012


Author: mjordan
Date: Tue Apr 17 13:25:44 2012
New Revision: 362304

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=362304
Log:
Fix error that caused seek format operations to set max file size to '1' or '0'

A very inappropriate placement of a ')' (introduced in r362151) caused the
maximum size of a file to be set as the result of a comparison operation, as
opposed to the result of the ftello operation.  This resulted in seeking being
restricted to the beginning of the file, or 1 byte into the file.  Thanks to
the Asterisk Test Suite for properly freaking out about this on at least one
test.

(issue ASTERISK-19655)
Reported by: Matt Jordan

Modified:
    branches/1.8/formats/format_g719.c
    branches/1.8/formats/format_gsm.c
    branches/1.8/formats/format_pcm.c
    branches/1.8/formats/format_siren14.c
    branches/1.8/formats/format_siren7.c
    branches/1.8/formats/format_sln.c
    branches/1.8/formats/format_sln16.c
    branches/1.8/formats/format_vox.c
    branches/1.8/formats/format_wav.c
    branches/1.8/formats/format_wav_gsm.c

Modified: branches/1.8/formats/format_g719.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/formats/format_g719.c?view=diff&rev=362304&r1=362303&r2=362304
==============================================================================
--- branches/1.8/formats/format_g719.c (original)
+++ branches/1.8/formats/format_g719.c Tue Apr 17 13:25:44 2012
@@ -92,7 +92,7 @@
 		return -1;
 	}
 
-	if ((max = ftello(fs->f) < 0)) {
+	if ((max = ftello(fs->f)) < 0) {
 		ast_log(AST_LOG_WARNING, "Unable to determine max position in g719 filestream %p: %s\n", fs, strerror(errno));
 		return -1;
 	}

Modified: branches/1.8/formats/format_gsm.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/formats/format_gsm.c?view=diff&rev=362304&r1=362303&r2=362304
==============================================================================
--- branches/1.8/formats/format_gsm.c (original)
+++ branches/1.8/formats/format_gsm.c Tue Apr 17 13:25:44 2012
@@ -120,7 +120,7 @@
 		return -1;
 	}
 
-	if ((max = ftello(fs->f) < 0)) {
+	if ((max = ftello(fs->f)) < 0) {
 		ast_log(AST_LOG_WARNING, "Unable to determine max position in g719 filestream %p: %s\n", fs, strerror(errno));
 		return -1;
 	}

Modified: branches/1.8/formats/format_pcm.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/formats/format_pcm.c?view=diff&rev=362304&r1=362303&r2=362304
==============================================================================
--- branches/1.8/formats/format_pcm.c (original)
+++ branches/1.8/formats/format_pcm.c Tue Apr 17 13:25:44 2012
@@ -115,7 +115,7 @@
 		return -1;
 	}
 
-	if ((max = ftello(fs->f) < 0)) {
+	if ((max = ftello(fs->f)) < 0) {
 		ast_log(AST_LOG_WARNING, "Unable to determine max position in pcm filestream %p: %s\n", fs, strerror(errno));
 		return -1;
 	}
@@ -414,7 +414,7 @@
 		return -1;
 	}
 
-	if ((max = ftello(fs->f) < 0)) {
+	if ((max = ftello(fs->f)) < 0) {
 		ast_log(AST_LOG_WARNING, "Unable to determine max position in au filestream %p: %s\n", fs, strerror(errno));
 		return -1;
 	}

Modified: branches/1.8/formats/format_siren14.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/formats/format_siren14.c?view=diff&rev=362304&r1=362303&r2=362304
==============================================================================
--- branches/1.8/formats/format_siren14.c (original)
+++ branches/1.8/formats/format_siren14.c Tue Apr 17 13:25:44 2012
@@ -92,7 +92,7 @@
 		return -1;
 	}
 
-	if ((max = ftello(fs->f) < 0)) {
+	if ((max = ftello(fs->f)) < 0) {
 		ast_log(AST_LOG_WARNING, "Unable to determine max position in siren14 filestream %p: %s\n", fs, strerror(errno));
 		return -1;
 	}

Modified: branches/1.8/formats/format_siren7.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/formats/format_siren7.c?view=diff&rev=362304&r1=362303&r2=362304
==============================================================================
--- branches/1.8/formats/format_siren7.c (original)
+++ branches/1.8/formats/format_siren7.c Tue Apr 17 13:25:44 2012
@@ -92,7 +92,7 @@
 		return -1;
 	}
 
-	if ((max = ftello(fs->f) < 0)) {
+	if ((max = ftello(fs->f)) < 0) {
 		ast_log(AST_LOG_WARNING, "Unable to determine max position in siren7 filestream %p: %s\n", fs, strerror(errno));
 		return -1;
 	}

Modified: branches/1.8/formats/format_sln.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/formats/format_sln.c?view=diff&rev=362304&r1=362303&r2=362304
==============================================================================
--- branches/1.8/formats/format_sln.c (original)
+++ branches/1.8/formats/format_sln.c Tue Apr 17 13:25:44 2012
@@ -90,7 +90,7 @@
 		return -1;
 	}
 
-	if ((max = ftello(fs->f) < 0)) {
+	if ((max = ftello(fs->f)) < 0) {
 		ast_log(AST_LOG_WARNING, "Unable to determine max position in sln filestream %p: %s\n", fs, strerror(errno));
 		return -1;
 	}

Modified: branches/1.8/formats/format_sln16.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/formats/format_sln16.c?view=diff&rev=362304&r1=362303&r2=362304
==============================================================================
--- branches/1.8/formats/format_sln16.c (original)
+++ branches/1.8/formats/format_sln16.c Tue Apr 17 13:25:44 2012
@@ -92,7 +92,7 @@
 		return -1;
 	}
 
-	if ((max = ftello(fs->f) < 0)) {
+	if ((max = ftello(fs->f)) < 0) {
 		ast_log(AST_LOG_WARNING, "Unable to determine max position in sln16 filestream %p: %s\n", fs, strerror(errno));
 		return -1;
 	}

Modified: branches/1.8/formats/format_vox.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/formats/format_vox.c?view=diff&rev=362304&r1=362303&r2=362304
==============================================================================
--- branches/1.8/formats/format_vox.c (original)
+++ branches/1.8/formats/format_vox.c Tue Apr 17 13:25:44 2012
@@ -90,7 +90,7 @@
 		return -1;
 	}
 
-	if ((max = ftello(fs->f) < 0)) {
+	if ((max = ftello(fs->f)) < 0) {
 		ast_log(AST_LOG_WARNING, "Unable to determine max position in g719 filestream %p: %s\n", fs, strerror(errno));
 		return -1;
 	}

Modified: branches/1.8/formats/format_wav.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/formats/format_wav.c?view=diff&rev=362304&r1=362303&r2=362304
==============================================================================
--- branches/1.8/formats/format_wav.c (original)
+++ branches/1.8/formats/format_wav.c Tue Apr 17 13:25:44 2012
@@ -468,7 +468,7 @@
 		return -1;
 	}
 
-	if ((max = ftello(fs->f) < 0)) {
+	if ((max = ftello(fs->f)) < 0) {
 		ast_log(AST_LOG_WARNING, "Unable to determine max position in wav filestream %p: %s\n", fs, strerror(errno));
 		return -1;
 	}

Modified: branches/1.8/formats/format_wav_gsm.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/formats/format_wav_gsm.c?view=diff&rev=362304&r1=362303&r2=362304
==============================================================================
--- branches/1.8/formats/format_wav_gsm.c (original)
+++ branches/1.8/formats/format_wav_gsm.c Tue Apr 17 13:25:44 2012
@@ -489,7 +489,7 @@
 	}
 
 	/* XXX ideally, should round correctly */
-	if ((max = ftello(fs->f) < 0)) {
+	if ((max = ftello(fs->f)) < 0) {
 		ast_log(AST_LOG_WARNING, "Unable to determine max position in WAV filestream %p: %s\n", fs, strerror(errno));
 		return -1;
 	}




More information about the svn-commits mailing list