Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/sys/dev Pull up revision 1.156 (requested by gmcgarry i...



details:   https://anonhg.NetBSD.org/src/rev/68c093c392df
branches:  netbsd-1-6
changeset: 529046:68c093c392df
user:      lukem <lukem%NetBSD.org@localhost>
date:      Tue Aug 27 09:46:17 2002 +0000

description:
Pull up revision 1.156 (requested by gmcgarry in ticket #729):
When audio recording was paused or dropping samples, the "outp" of the
recording ring buffer could overrun the end of the buffer.  When
recording resumed, memory after the end of the buffer would be read,
sometimes causing a system crash.

diffstat:

 sys/dev/audio.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 77a251db8013 -r 68c093c392df sys/dev/audio.c
--- a/sys/dev/audio.c   Tue Aug 27 09:33:35 2002 +0000
+++ b/sys/dev/audio.c   Tue Aug 27 09:46:17 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audio.c,v 1.155.4.1 2002/06/24 05:06:27 lukem Exp $    */
+/*     $NetBSD: audio.c,v 1.155.4.2 2002/08/27 09:46:17 lukem Exp $    */
 
 /*
  * Copyright (c) 1991-1993 Regents of the University of California.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.155.4.1 2002/06/24 05:06:27 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.155.4.2 2002/08/27 09:46:17 lukem Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -2276,11 +2276,15 @@
                DPRINTFN(1, ("audio_rint: pdrops %lu\n", cb->pdrops));
                cb->pdrops += blksize;
                cb->outp += blksize;
+               if (cb->outp >= cb->end)
+                       cb->outp = cb->start;
                cb->used -= blksize;
        } else if (cb->used + blksize >= cb->usedhigh && !cb->copying) {
                DPRINTFN(1, ("audio_rint: drops %lu\n", cb->drops));
                cb->drops += blksize;
                cb->outp += blksize;
+               if (cb->outp >= cb->end)
+                       cb->outp = cb->start;
                cb->used -= blksize;
        }
 



Home | Main Index | Thread Index | Old Index