From 8176119bc432d0ddb6187a4a84c81a7d9489153a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 17 Mar 2011 23:42:43 -0700 Subject: [PATCH] * sound.c (wav_play): Initialize a variable to 0, to prevent undefined behavior. --- src/ChangeLog | 1 + src/sound.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index b35cae14094..69aaa359887 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -3,6 +3,7 @@ * sound.c (wav_play, au_play, Fplay_sound_internal): Fix pointer signedness. (alsa_choose_format): Remove unused local var. + (wav_play): Initialize a variable to 0, to prevent undefined behavior. * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing. diff --git a/src/sound.c b/src/sound.c index c886c8c40b1..a2fe7ccc8ce 100644 --- a/src/sound.c +++ b/src/sound.c @@ -600,7 +600,7 @@ wav_play (struct sound *s, struct sound_device *sd) else { char *buffer; - int nbytes; + int nbytes = 0; int blksize = sd->period_size ? sd->period_size (sd) : 2048; int data_left = header->data_length; -- 2.39.2