aboutsummaryrefslogtreecommitdiffstats
path: root/main/mplayer
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-04-30 08:41:48 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2015-04-30 08:42:17 +0000
commitcf744efe321fd0cb1fe3b3dfe04892e0ce88720d (patch)
treea8d93c87ad40331dbaadd61cfecdba51dd99496e /main/mplayer
parent7194277a5d161e9050ab7f5bcfc9f9bd0d32c03e (diff)
downloadaports-cf744efe321fd0cb1fe3b3dfe04892e0ce88720d.tar.bz2
aports-cf744efe321fd0cb1fe3b3dfe04892e0ce88720d.tar.xz
main/mplayer: fix libavutil to build with fortify
Diffstat (limited to 'main/mplayer')
-rw-r--r--main/mplayer/APKBUILD13
-rw-r--r--main/mplayer/libavutil-fortify.patch58
2 files changed, 66 insertions, 5 deletions
diff --git a/main/mplayer/APKBUILD b/main/mplayer/APKBUILD
index 9cbcbf16b8..109a2951c4 100644
--- a/main/mplayer/APKBUILD
+++ b/main/mplayer/APKBUILD
@@ -2,7 +2,7 @@
pkgname=mplayer
pkgver=1.1.1
_ver=${pkgver/_/}
-pkgrel=7
+pkgrel=8
pkgdesc="A movie player for linux"
url="http://www.mplayerhq.hu/"
arch="x86_64"
@@ -17,6 +17,7 @@ makedepends="libxxf86dga-dev libxv-dev libmad-dev lame-dev libao-dev
source="ftp://ftp1.mplayerhq.hu/MPlayer/releases/MPlayer-$pkgver.tar.xz
cdio-includes.patch
x11-libs.patch
+ libavutil-fortify.patch
"
_builddir="$srcdir"/MPlayer-$_ver
prepare() {
@@ -38,7 +39,6 @@ build() {
--disable-gif \
--disable-arts \
--enable-x11 \
- --enable-runtime-cpudetection \
--confdir=/etc/mplayer \
--disable-nas \
--enable-gl \
@@ -79,10 +79,13 @@ package() {
}
md5sums="39dd55f30eb5403f219a606e79a6648a MPlayer-1.1.1.tar.xz
6a7826f8cb9ac1b99a0842f202b22cfc cdio-includes.patch
-01bcc935a6b429347e8e77e1a70bf2b2 x11-libs.patch"
+01bcc935a6b429347e8e77e1a70bf2b2 x11-libs.patch
+2536e461e83a7547a163de7375b4967e libavutil-fortify.patch"
sha256sums="ce8fc7c3179e6a57eb3a58cb7d1604388756b8a61764cc93e095e7aff3798c76 MPlayer-1.1.1.tar.xz
bd29643fd26b09f3c0af1fb3c5ad61a5697eb3a29bc3e92ec5a2bc1a91038fdf cdio-includes.patch
-924ae52abeaad41e4d14c0af82d52a6d65985f3b1c77fa432ed04a5ccbc4c24c x11-libs.patch"
+924ae52abeaad41e4d14c0af82d52a6d65985f3b1c77fa432ed04a5ccbc4c24c x11-libs.patch
+e0ce451ec1e8b5d080352040ef0aa59871ba02af1faa1c835169c1021ba3d056 libavutil-fortify.patch"
sha512sums="06371d47b02caec83c7662f6bb4a827eafb7f3309f6cda959a0f49b647df031166a6e7c5d530b57b580104289ee260aa96f3f43cbfffcef816cea776b0d5aed0 MPlayer-1.1.1.tar.xz
5ab1e62614201cfbf8fe5a111cfc24c895bae6c755f4fcb23c5d990b13dc9e7671c60e275690c80c0cc5ca9139f12afdf16b15900e56043f797ffa17521d35f0 cdio-includes.patch
-bba012c5a116cbc6715955a0a563c89a33a1d8ad3c44301a083ce65296ba9112a88a58e38c874d9347f9c3133054e62bd16d3b3367383f207ee40ddae105081c x11-libs.patch"
+bba012c5a116cbc6715955a0a563c89a33a1d8ad3c44301a083ce65296ba9112a88a58e38c874d9347f9c3133054e62bd16d3b3367383f207ee40ddae105081c x11-libs.patch
+5afa4a8a3d6f4ece1a4db9d35b2e07e108751b3edc3c8d5192c97c6d4209ac041f5b29e647f68ea895a5f41360c205ee70cd56a7ea857716f5f7b177a72c0d74 libavutil-fortify.patch"
diff --git a/main/mplayer/libavutil-fortify.patch b/main/mplayer/libavutil-fortify.patch
new file mode 100644
index 0000000000..23bc7cc0a7
--- /dev/null
+++ b/main/mplayer/libavutil-fortify.patch
@@ -0,0 +1,58 @@
+remove #defines to prevent use of discouraged external functions
+
+Preventing the use of discouraged or 'insecure' external functions
+through defines in an internal header is not a good solution. The
+header is not guaranteed to be included universally which makes
+overlooking bad use of said functions during review more likely.
+
+There are cases were those functions either are the most straight
+forward solution or even have to be used. Using malloc or free is
+required if the allocation or release is done by other libraries.
+
+https://github.com/FFmpeg/FFmpeg/commit/e96d90eed66a198566c409958432d282e1b03869
+
+--- ./ffmpeg/libavutil/internal.h.orig
++++ ./ffmpeg/libavutil/internal.h
+@@ -125,42 +125,6 @@
+ level = (level ^ mask) - mask;
+ #endif
+
+-/* avoid usage of dangerous/inappropriate system functions */
+-#undef malloc
+-#define malloc please_use_av_malloc
+-#undef free
+-#define free please_use_av_free
+-#undef realloc
+-#define realloc please_use_av_realloc
+-#undef time
+-#define time time_is_forbidden_due_to_security_issues
+-#undef rand
+-#define rand rand_is_forbidden_due_to_state_trashing_use_av_lfg_get
+-#undef srand
+-#define srand srand_is_forbidden_due_to_state_trashing_use_av_lfg_init
+-#undef random
+-#define random random_is_forbidden_due_to_state_trashing_use_av_lfg_get
+-#undef sprintf
+-#define sprintf sprintf_is_forbidden_due_to_security_issues_use_snprintf
+-#undef strcat
+-#define strcat strcat_is_forbidden_due_to_security_issues_use_av_strlcat
+-#undef strncpy
+-#define strncpy strncpy_is_forbidden_due_to_security_issues_use_av_strlcpy
+-#undef exit
+-#define exit exit_is_forbidden
+-#undef printf
+-#define printf please_use_av_log_instead_of_printf
+-#undef fprintf
+-#define fprintf please_use_av_log_instead_of_fprintf
+-#undef puts
+-#define puts please_use_av_log_instead_of_puts
+-#undef perror
+-#define perror please_use_av_log_instead_of_perror
+-#undef strcasecmp
+-#define strcasecmp please_use_av_strcasecmp
+-#undef strncasecmp
+-#define strncasecmp please_use_av_strncasecmp
+-
+ #define FF_ALLOC_OR_GOTO(ctx, p, size, label)\
+ {\
+ p = av_malloc(size);\