diff options
Diffstat (limited to 'formats/format_g729.c')
-rwxr-xr-x | formats/format_g729.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/formats/format_g729.c b/formats/format_g729.c index 746c40b8a..68dde216f 100755 --- a/formats/format_g729.c +++ b/formats/format_g729.c @@ -183,8 +183,9 @@ static int g729_seek(struct ast_filestream *fs, long sample_offset, int whence) offset = max - bytes; if (whence != SEEK_FORCECUR) { offset = (offset > max)?max:offset; - offset = (offset < min)?min:offset; } + // protect against seeking beyond begining. + offset = (offset < min)?min:offset; if (lseek(fs->fd, offset, SEEK_SET) < 0) return -1; return 0; |