new package: mplayer

This commit is contained in:
Tee KOBAYASHI 2022-03-05 15:32:17 +09:00 committed by xtkoba
parent b09a6a5fcc
commit 4a2e9ca1d7
5 changed files with 101 additions and 0 deletions

36
packages/mplayer/build.sh Normal file
View File

@ -0,0 +1,36 @@
TERMUX_PKG_HOMEPAGE=https://mplayerhq.hu/
TERMUX_PKG_DESCRIPTION="The Movie Player"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=1.4
TERMUX_PKG_SRCURL=https://ftp-osl.osuosl.org/pub/gentoo/distfiles/MPlayer-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=82596ed558478d28248c7bc3828eb09e6948c099bbd76bb7ee745a0e3275b548
TERMUX_PKG_DEPENDS="ffmpeg, libbz2, ncurses, zlib"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
--disable-ffmpeg_a
--disable-vidix
--disable-gl
"
TERMUX_PKG_EXTRA_MAKE_ARGS="INSTALLSTRIP="
TERMUX_PKG_BLACKLISTED_ARCHES="i686"
termux_step_post_get_source() {
termux_download \
"https://github.com/gentoo/gentoo/raw/a3045b07e451738d566af36b38e96dbf76d8659c/media-video/mplayer/files/ffmpeg44.patch" \
$TERMUX_PKG_CACHEDIR/mplayer-ffmpeg44.patch \
eb796b380f9ed9a6a68ee523493dce5f27fc57b8c0dea0d44a13752ec7411fcd
cat $TERMUX_PKG_CACHEDIR/mplayer-ffmpeg44.patch | patch --silent -p1
termux_download \
"https://dev.gentoo.org/~aballier/distfiles/mplayer-1.4-ffmpeg5.patch.bz2" \
$TERMUX_PKG_CACHEDIR/mplayer-1.4-ffmpeg5.patch.bz2 \
3397eb50fe7265dc435f6df824cd6153440c14029c8a0be76056ae89733970db
bzcat $TERMUX_PKG_CACHEDIR/mplayer-1.4-ffmpeg5.patch.bz2 | patch --silent -p1
}
termux_step_configure_autotools() {
sh "$TERMUX_PKG_SRCDIR/configure" \
--target=$TERMUX_HOST_PLATFORM \
--prefix=$TERMUX_PREFIX \
$TERMUX_PKG_EXTRA_CONFIGURE_ARGS
}

View File

@ -0,0 +1,11 @@
--- a/command.c
+++ b/command.c
@@ -3375,7 +3375,7 @@
if (!fork()) {
char *exp_cmd = property_expand_string(mpctx, cmd->args[0].v.s);
if (exp_cmd) {
- execl("/bin/sh", "sh", "-c", exp_cmd, NULL);
+ execl("@TERMUX_PREFIX@/bin/sh", "sh", "-c", exp_cmd, NULL);
free(exp_cmd);
}
exit(0);

View File

@ -0,0 +1,11 @@
--- a/configure
+++ b/configure
@@ -2861,7 +2861,7 @@
fi
CFLAGS="-D_ISOC99_SOURCE -I. -Iffmpeg $CFLAGS"
-HOSTCFLAGS="-D_ISOC99_SOURCE -I. -Iffmpeg -O3"
+HOSTCFLAGS="-D_ISOC99_SOURCE -I. -Iffmpeg -idirafter @TERMUX_PREFIX@/include -O3"
# On glibc, add some more CPPFLAGS for enabling required functionality.
cpp_condition_check features.h "defined __GLIBC__" &&

View File

@ -0,0 +1,19 @@
--- a/libmpcodecs/vf_fixpts.c
+++ b/libmpcodecs/vf_fixpts.c
@@ -103,7 +103,7 @@
return 1;
}
-static int open(vf_instance_t *vf, char *args)
+static int vf_open(vf_instance_t *vf, char *args)
{
struct vf_priv_s *p;
struct vf_priv_s ptmp = {
@@ -132,6 +132,6 @@
"fixpts",
"Nicolas George",
"",
- &open,
+ &vf_open,
NULL
};

View File

@ -0,0 +1,24 @@
https://nvd.nist.gov/vuln/detail/CVE-2016-4352
https://www.openwall.com/lists/oss-security/2016/04/29/7
https://trac.mplayerhq.hu/ticket/2295
--- a/libmpdemux/demux_gif.c
+++ b/libmpdemux/demux_gif.c
@@ -316,6 +316,17 @@
return NULL;
}
+ // Validate image size, most code in this demuxer assumes w*h <= INT_MAX
+ if ((int64_t)gif->SWidth * gif->SHeight > INT_MAX) {
+ mp_msg(MSGT_DEMUX, MSGL_ERR,
+ "[demux_gif] Unsupported picture size %dx%d.\n", gif->SWidth,
+ gif->SHeight);
+ if (DGifCloseFile(gif) == GIF_ERROR)
+ print_gif_error(NULL);
+ free(priv);
+ return NULL;
+ }
+
// create a new video stream header
sh_video = new_sh_video(demuxer, 0);