diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/oss/dmabuf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/oss/dmabuf.c b/sound/oss/dmabuf.c index eaf69971bf92..1e90d769b62e 100644 --- a/sound/oss/dmabuf.c +++ b/sound/oss/dmabuf.c | |||
@@ -795,9 +795,9 @@ static int find_output_space(int dev, char **buf, int *size) | |||
795 | #ifdef BE_CONSERVATIVE | 795 | #ifdef BE_CONSERVATIVE |
796 | active_offs = dmap->byte_counter + dmap->qhead * dmap->fragment_size; | 796 | active_offs = dmap->byte_counter + dmap->qhead * dmap->fragment_size; |
797 | #else | 797 | #else |
798 | active_offs = DMAbuf_get_buffer_pointer(dev, dmap, DMODE_OUTPUT); | 798 | active_offs = max(DMAbuf_get_buffer_pointer(dev, dmap, DMODE_OUTPUT), 0); |
799 | /* Check for pointer wrapping situation */ | 799 | /* Check for pointer wrapping situation */ |
800 | if (active_offs < 0 || active_offs >= dmap->bytes_in_use) | 800 | if (active_offs >= dmap->bytes_in_use) |
801 | active_offs = 0; | 801 | active_offs = 0; |
802 | active_offs += dmap->byte_counter; | 802 | active_offs += dmap->byte_counter; |
803 | #endif | 803 | #endif |