From a6338f1f34fd6e458e7283a9639573efe1942477 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 14 Jan 2007 18:25:26 +0000 Subject: * Security fix. svn path=/nixpkgs/trunk/; revision=7665 --- pkgs/applications/video/MPlayer/asmrules-fix.patch | 68 ++++++++++++++++++++++ pkgs/applications/video/MPlayer/default.nix | 16 +++-- 2 files changed, 79 insertions(+), 5 deletions(-) create mode 100644 pkgs/applications/video/MPlayer/asmrules-fix.patch (limited to 'pkgs/applications') diff --git a/pkgs/applications/video/MPlayer/asmrules-fix.patch b/pkgs/applications/video/MPlayer/asmrules-fix.patch new file mode 100644 index 000000000000..efdfe6b307dd --- /dev/null +++ b/pkgs/applications/video/MPlayer/asmrules-fix.patch @@ -0,0 +1,68 @@ +diff -rc MPlayer-1.0rc1-orig/stream/realrtsp/asmrp.c MPlayer-1.0rc1/stream/realrtsp/asmrp.c +*** MPlayer-1.0rc1-orig/stream/realrtsp/asmrp.c 2006-10-23 00:32:25.000000000 +0200 +--- MPlayer-1.0rc1/stream/realrtsp/asmrp.c 2007-01-14 19:11:06.000000000 +0100 +*************** +*** 40,45 **** +--- 40,46 ---- + #include + #include + #include ++ #include "asmrp.h" + + /* + #define LOG +*************** +*** 645,652 **** + #ifdef LOG + printf ("rule #%d is true\n", rule_num); + #endif +! matches[num_matches] = rule_num; +! num_matches++; + } + + rule_num++; +--- 646,655 ---- + #ifdef LOG + printf ("rule #%d is true\n", rule_num); + #endif +! if(num_matches < MAX_RULEMATCHES - 1) +! matches[num_matches++] = rule_num; +! else +! printf("Ignoring matched asm rule %d, too many matched rules.\n", rule_num); + } + + rule_num++; +diff -rc MPlayer-1.0rc1-orig/stream/realrtsp/asmrp.h MPlayer-1.0rc1/stream/realrtsp/asmrp.h +*** MPlayer-1.0rc1-orig/stream/realrtsp/asmrp.h 2006-10-23 00:32:25.000000000 +0200 +--- MPlayer-1.0rc1/stream/realrtsp/asmrp.h 2007-01-14 19:11:06.000000000 +0100 +*************** +*** 40,45 **** +--- 40,47 ---- + #ifndef HAVE_ASMRP_H + #define HAVE_ASMRP_H + ++ #define MAX_RULEMATCHES 16 ++ + int asmrp_match (const char *rules, int bandwidth, int *matches) ; + + #endif +diff -rc MPlayer-1.0rc1-orig/stream/realrtsp/real.c MPlayer-1.0rc1/stream/realrtsp/real.c +*** MPlayer-1.0rc1-orig/stream/realrtsp/real.c 2006-10-23 00:32:25.000000000 +0200 +--- MPlayer-1.0rc1/stream/realrtsp/real.c 2007-01-14 19:11:06.000000000 +0100 +*************** +*** 271,277 **** + int j=0; + int n; + char b[64]; +! int rulematches[16]; + + #ifdef LOG + printf("calling asmrp_match with:\n%s\n%u\n", desc->stream[i]->asm_rule_book, bandwidth); +--- 271,277 ---- + int j=0; + int n; + char b[64]; +! int rulematches[MAX_RULEMATCHES]; + + #ifdef LOG + printf("calling asmrp_match with:\n%s\n%u\n", desc->stream[i]->asm_rule_book, bandwidth); diff --git a/pkgs/applications/video/MPlayer/default.nix b/pkgs/applications/video/MPlayer/default.nix index 225b0669696b..acc4ab59d970 100644 --- a/pkgs/applications/video/MPlayer/default.nix +++ b/pkgs/applications/video/MPlayer/default.nix @@ -21,7 +21,7 @@ let in stdenv.mkDerivation { - name = "MPlayer-1.0rc1"; + name = "MPlayer-1.0rc1try2"; src = fetchurl { url = http://www1.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc1.tar.bz2; @@ -50,10 +50,16 @@ stdenv.mkDerivation { # Provide a reasonable standard font. Maybe we should symlink here. postInstall = "cp ${freefont_ttf}/share/fonts/truetype/FreeSans.ttf $out/share/mplayer/subfont.ttf"; - # These fix MPlayer's aspect ratio when run in a screen rotated with - # Xrandr. - # See: http://itdp.de/~itdp/html/mplayer-dev-eng/2005-08/msg00427.html - patches = [./mplayer-aspect.patch ./mplayer-pivot.patch]; + patches = [ + # These fix MPlayer's aspect ratio when run in a screen rotated with + # Xrandr. + # See: http://itdp.de/~itdp/html/mplayer-dev-eng/2005-08/msg00427.html + ./mplayer-aspect.patch + ./mplayer-pivot.patch + + # Security fix. + ./asmrules-fix.patch + ]; meta = { description = "A movie player that supports many video formats"; -- cgit 1.4.1