diff options
Diffstat (limited to 'formats/format_gsm.c')
-rwxr-xr-x | formats/format_gsm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/formats/format_gsm.c b/formats/format_gsm.c index 4ac2b5a5d..d58039e6d 100755 --- a/formats/format_gsm.c +++ b/formats/format_gsm.c @@ -197,9 +197,10 @@ static int gsm_seek(struct ast_filestream *fs, long sample_offset, int whence) offset = distance + cur; else if(whence == SEEK_END) offset = max - distance; + // Always protect against seeking past the begining. + offset = (offset < min)?min:offset; if (whence != SEEK_FORCECUR) { offset = (offset > max)?max:offset; - offset = (offset < min)?min:offset; } else if (offset > max) { int i; lseek(fs->fd, 0, SEEK_END); |