Module Name: src Committed By: mlelstv Date: Mon May 1 16:35:47 UTC 2023
Modified Files: src/sys/dev/pad: pad.c Log Message: Don't overflow when scaling 32bit samples. To generate a diff of this commit: cvs rdiff -u -r1.81 -r1.82 src/sys/dev/pad/pad.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pad/pad.c diff -u src/sys/dev/pad/pad.c:1.81 src/sys/dev/pad/pad.c:1.82 --- src/sys/dev/pad/pad.c:1.81 Sun Apr 23 08:21:11 2023 +++ src/sys/dev/pad/pad.c Mon May 1 16:35:47 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: pad.c,v 1.81 2023/04/23 08:21:11 mlelstv Exp $ */ +/* $NetBSD: pad.c,v 1.82 2023/05/01 16:35:47 mlelstv Exp $ */ /*- * Copyright (c) 2007 Jared D. McNeill <jmcne...@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.81 2023/04/23 08:21:11 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.82 2023/05/01 16:35:47 mlelstv Exp $"); #include <sys/param.h> #include <sys/types.h> @@ -756,7 +756,7 @@ pad_swvol_codec(audio_filter_arg_t *arg) bits = arg->srcfmt->precision; for (i = 0; i < sample_count; i++) { - int32_t v; + int64_t v; switch (howmany(bits, NBBY)) { case 2: /* AUDIO_INTERNAL_BITS == 16 */