From: Simon Glass Date: Fri, 16 Nov 2018 02:56:12 +0000 (-0700) Subject: sound: Correct data output in sound_create_square_wave() X-Git-Url: http://git.dujemihanovic.xyz/html/static/git-favicon.png?a=commitdiff_plain;h=03f11e87a86307903f40e74495936184063bab79;p=u-boot.git sound: Correct data output in sound_create_square_wave() This function currently outputs twice as much data as it should and overwrites its buffer as a result. Fix it. Signed-off-by: Simon Glass --- diff --git a/drivers/sound/sound.c b/drivers/sound/sound.c index 969408186f..6c1eb4c19c 100644 --- a/drivers/sound/sound.c +++ b/drivers/sound/sound.c @@ -25,12 +25,10 @@ void sound_create_square_wave(unsigned short *data, int size, uint32_t freq) for (i = 0; size && i < half; i++) { size -= 2; *data++ = amplitude; - *data++ = amplitude; } for (i = 0; size && i < period - half; i++) { size -= 2; *data++ = -amplitude; - *data++ = -amplitude; } } }