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 ........ Merged revisions 362304 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 362305 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362306 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
8337ecd38d
commit
70c5ac6635
|
@ -92,7 +92,7 @@ static int g719seek(struct ast_filestream *fs, off_t sample_offset, int whence)
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -120,7 +120,7 @@ static int gsm_seek(struct ast_filestream *fs, off_t sample_offset, int whence)
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ static int pcm_seek(struct ast_filestream *fs, off_t sample_offset, int whence)
|
|||
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 @@ static int au_seek(struct ast_filestream *fs, off_t sample_offset, int whence)
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ static int siren14seek(struct ast_filestream *fs, off_t sample_offset, int whenc
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ static int siren7seek(struct ast_filestream *fs, off_t sample_offset, int whence
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ static int slinear_seek(struct ast_filestream *fs, off_t sample_offset, int when
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ static int vox_seek(struct ast_filestream *fs, off_t sample_offset, int whence)
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -468,7 +468,7 @@ static int wav_seek(struct ast_filestream *fs, off_t sample_offset, int whence)
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -489,7 +489,7 @@ static int wav_seek(struct ast_filestream *fs, off_t sample_offset, int whence)
|
|||
}
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue