From: John Sauter <John_Sauter@systemeyescomputerstore.com>
To: scott.gilliland@gatech.edu
Cc: alsa-devel@alsa-project.org
Subject: Re: Fix bug in arecord --max-file-time where the file size could overflow 32 bits
Date: Sat, 24 Jun 2017 04:39:19 -0400 [thread overview]
Message-ID: <1498293559.2383.3.camel@systemeyescomputerstore.com> (raw)
In-Reply-To: <mailman.1530.1498285564.896.alsa-devel@alsa-project.org>
[-- Attachment #1.1: Type: text/plain, Size: 1756 bytes --]
> Date: Fri, 23 Jun 2017 18:35:03 +0000
> From: "Gilliland, Scott M" <scott.gilliland@gatech.edu>
> To: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
> Subject: [alsa-devel] [PATCH] Fix bug in arecord --max-file-time
> where
> the file size could overflow 32 bits
> Message-ID:
> <CY4PR07MB3544F3467606CB0401C3F0918DD80@CY4PR07MB3544.namprd07.
> prod.outlook.com>
>
> Content-Type: text/plain; charset="iso-8859-1"
>
> From: Scott Gilliland <scott.gilliland@gatech.edu>
>
> Fix bug in arecord --max-file-time where the file size could overflow
> 32 bits
>
> Signed-off-by: Scott Gilliland <scott.gilliland@gatech.edu>
> ---
> aplay/aplay.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/aplay/aplay.c b/aplay/aplay.c
> index f793c82..00af662 100644
> --- a/aplay/aplay.c
> +++ b/aplay/aplay.c
> @@ -3027,7 +3027,7 @@ static void capture(char *orig_name)
> if (count == 0)
> count = LLONG_MAX;
> /* compute the number of bytes per file */
> - max_file_size = max_file_time *
> + max_file_size = (long long) max_file_time *
> snd_pcm_format_size(hwparams.format,
> hwparams.rate *
> hwparams.channels);
> /* WAVE-file should be even (I'm not sure), but wasting one
> byte
> --
> 2.11.0
Thank you for fixing this bug, which I introduced in 2010 through
failing to understand the type conversion rules of C.
Acked-by: John Sauter <John_Sauter@systemeyescomputerstore.com>
--
PGP fingerprint E24A D25B E5FE 4914 A603 49EC 7030 3EA1 9A0B 511E
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
parent reply other threads:[~2017-06-24 8:39 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <mailman.1530.1498285564.896.alsa-devel@alsa-project.org>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1498293559.2383.3.camel@systemeyescomputerstore.com \
--to=john_sauter@systemeyescomputerstore.com \
--cc=alsa-devel@alsa-project.org \
--cc=scott.gilliland@gatech.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox