moc: fix crash when playing AAC on musl
This moves a buffer (currently 36 KiB) to the heap, avoiding stack overflow on musl.
This commit is contained in:
parent
b5c5858ecd
commit
41109a27f3
2 changed files with 29 additions and 1 deletions
28
srcpkgs/moc/patches/move-pcm-buffer-to-heap.patch
Normal file
28
srcpkgs/moc/patches/move-pcm-buffer-to-heap.patch
Normal file
|
@ -0,0 +1,28 @@
|
|||
--- player.c 2018-02-10 23:53:38.627091352 +0100
|
||||
+++ player.c 2018-02-10 23:54:46.672519217 +0100
|
||||
@@ -444,7 +444,7 @@
|
||||
{
|
||||
bool eof = false;
|
||||
bool stopped = false;
|
||||
- char buf[PCM_BUF_SIZE];
|
||||
+ char *const buf = xmalloc (PCM_BUF_SIZE);
|
||||
int decoded = 0;
|
||||
struct sound_params new_sound_params;
|
||||
bool sound_params_change = false;
|
||||
@@ -486,7 +486,7 @@
|
||||
status_msg ("Playing...");
|
||||
}
|
||||
|
||||
- decoded = f->decode (decoder_data, buf, sizeof(buf),
|
||||
+ decoded = f->decode (decoder_data, buf, PCM_BUF_SIZE,
|
||||
&new_sound_params);
|
||||
|
||||
if (decoded)
|
||||
@@ -629,6 +629,7 @@
|
||||
precache.f->close (precache.decoder_data);
|
||||
precache_reset (&precache);
|
||||
}
|
||||
+ free (buf);
|
||||
}
|
||||
|
||||
#if !defined(NDEBUG) && defined(DEBUG)
|
|
@ -1,7 +1,7 @@
|
|||
# Template file for 'moc'
|
||||
pkgname=moc
|
||||
version=2.5.2
|
||||
revision=1
|
||||
revision=2
|
||||
build_style=gnu-configure
|
||||
hostmakedepends="pkg-config"
|
||||
makedepends="db-devel ncurses-devel libcurl-devel popt-devel ffmpeg-devel
|
||||
|
|
Loading…
Reference in a new issue