Package: madplay
Version: 0.15.2b-7
Severity: normal
Tags: patch
The ALSA audio output code allocates a PCM buffer based on whatever the current
ALSA buffer size happens to be rather than what madplay's audio code wants
to write to it.
The attached patch always allocates the maximum (55296 bytes), which parallels
the behavior of the OSS output code. It fixes the crashes for me.
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 3.1.1 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages madplay depends on:
ii libasound2 1.0.24.1-4 shared library for ALSA applicatio
ii libc6 2.13-27 Embedded GNU C Library: Shared lib
ii libesd0 0.2.41-10 Enlightened Sound Daemon - Shared
ii libid3tag0 0.15.1b-10 ID3 tag reading library from the M
ii libmad0 0.15.1b-7 MPEG audio decoder library
madplay recommends no packages.
madplay suggests no packages.
-- no debconf information
--- madplay-0.15.2b.orig/audio_alsa.c 2004-02-23 16:35:23.000000000 -0500
+++ madplay-0.15.2b/audio_alsa.c 2012-04-04 00:07:44.965023179 -0400
@@ -241,7 +241,7 @@
return -1;
}
- buf = malloc(buffer_size);
+ buf = malloc(MAX_NSAMPLES * 4 * 2);
if (buf == NULL) {
audio_error="unable to allocate output buffer table";
return -1;
@@ -343,6 +343,8 @@
audio_error = snd_strerror(err);
return -1;
}
+
+ free(buf);
return 0;