From: Paul Eggert Date: Fri, 18 Mar 2011 06:42:43 +0000 (-0700) Subject: * sound.c (wav_play): Initialize a variable to 0, to prevent undefined behavior. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~513^2~52 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8176119bc432d0ddb6187a4a84c81a7d9489153a;p=emacs.git * sound.c (wav_play): Initialize a variable to 0, to prevent undefined behavior. --- 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;