aboutsummaryrefslogtreecommitdiffstats
path: root/main/mplayer/libavutil-fortify.patch
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/libavutil-fortify.patch
parent7194277a5d161e9050ab7f5bcfc9f9bd0d32c03e (diff)
downloadaports-cf744efe321fd0cb1fe3b3dfe04892e0ce88720d.tar.bz2
aports-cf744efe321fd0cb1fe3b3dfe04892e0ce88720d.tar.xz
main/mplayer: fix libavutil to build with fortify
Diffstat (limited to 'main/mplayer/libavutil-fortify.patch')
-rw-r--r--main/mplayer/libavutil-fortify.patch58
1 files changed, 58 insertions, 0 deletions
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);\