From a3d9d7b58b80fa8de7d197067675786e051114d3 Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Thu, 15 Apr 2004 16:02:42 +0000 Subject: Do proper bounds checking in formats (bug #1356) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2694 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- formats/format_pcm_alaw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'formats/format_pcm_alaw.c') diff --git a/formats/format_pcm_alaw.c b/formats/format_pcm_alaw.c index 62103068d..db6b0c3d0 100755 --- a/formats/format_pcm_alaw.c +++ b/formats/format_pcm_alaw.c @@ -253,8 +253,9 @@ static int pcm_seek(struct ast_filestream *fs, long sample_offset, int whence) offset = max - sample_offset; if (whence != SEEK_FORCECUR) { offset = (offset > max)?max:offset; - offset = (offset < min)?min:offset; } + // Always protect against seeking past begining + offset = (offset < min)?min:offset; return lseek(fs->fd, offset, SEEK_SET); } -- cgit v1.2.3