summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris White <chriswhite@gentoo.org>2004-07-19 04:24:07 +0000
committerChris White <chriswhite@gentoo.org>2004-07-19 04:24:07 +0000
commit11515351340e02bfc0226fa36a2c64488716b867 (patch)
tree361e5207129bffe55faccc05a10a4a72b3aa961d /media-video
parentPatch to fix compilation when using gcc-2 (diff)
downloadhistorical-11515351340e02bfc0226fa36a2c64488716b867.tar.gz
historical-11515351340e02bfc0226fa36a2c64488716b867.tar.bz2
historical-11515351340e02bfc0226fa36a2c64488716b867.zip
Fixes compiling issues to ready -r5 for amd64 stable marking for mplayer gui vulnerability bug.
Diffstat (limited to 'media-video')
-rw-r--r--media-video/mplayer/ChangeLog7
-rw-r--r--media-video/mplayer/Manifest73
-rw-r--r--media-video/mplayer/files/gui_vuln_code.patch417
-rw-r--r--media-video/mplayer/files/str_undefined.patch68
-rw-r--r--media-video/mplayer/files/strl.c47
-rw-r--r--media-video/mplayer/mplayer-1.0_pre4-r5.ebuild10
6 files changed, 583 insertions, 39 deletions
diff --git a/media-video/mplayer/ChangeLog b/media-video/mplayer/ChangeLog
index f8d8fde0be17..6200e8b22a4a 100644
--- a/media-video/mplayer/ChangeLog
+++ b/media-video/mplayer/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for media-video/mplayer
# Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/mplayer/ChangeLog,v 1.162 2004/07/18 06:46:07 chriswhite Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-video/mplayer/ChangeLog,v 1.163 2004/07/19 04:24:07 chriswhite Exp $
+
+ 19 Jul 2004; Chris White <chriswhite@gentoo.org> +files/gui_vuln_code.patch,
+ +files/str_undefined.patch, +files/strl.c, mplayer-1.0_pre4-r5.ebuild:
+ Fixed mplayer pre4-r5 compiling issues with undefined str* references and
+ re-stabilized for gui vuln bug for amd64. Added fullscreen patch as well.
16 Jul 2004; Bryan Østergaard <kloeri@gentoo.org> mplayer-1.0_pre5.ebuild:
Stable on alpha, see bug #55456.
diff --git a/media-video/mplayer/Manifest b/media-video/mplayer/Manifest
index 42d5d8a68144..b0036dfdc8be 100644
--- a/media-video/mplayer/Manifest
+++ b/media-video/mplayer/Manifest
@@ -1,51 +1,54 @@
+MD5 a61fae0840c188f678be5d9db8afbbdf ChangeLog 29007
+MD5 9ef4af14dad87b03fde8e43f19e08d26 metadata.xml 225
+MD5 b813a65769af5d2a2ca1ceba1347974d mplayer-0.92-r1.ebuild 11511
+MD5 7eeb1235c1263ecb110925e53de1eb06 mplayer-1.0_pre2-r1.ebuild 11375
+MD5 8fd3c8b66040b26bb9f3963b5fe96bb2 mplayer-1.0_pre3-r3.ebuild 11498
MD5 d40969fad743a58087e55fd5d27d3fcf mplayer-1.0_pre3-r4.ebuild 11799
+MD5 5d11f22039a718f19a725f676e614670 mplayer-1.0_pre3-r5.ebuild 11473
+MD5 1c2c6d32766ce3bf0974895533252491 mplayer-1.0_pre4-r1.ebuild 11659
+MD5 fbdd96b2a3f0f78bdc8cbded3bb3927b mplayer-1.0_pre4-r2.ebuild 11948
MD5 6b9e16c4f08ac48748812909ed431f31 mplayer-1.0_pre4-r3.ebuild 13034
+MD5 8ed989ffc5161e49095f6f977fec6a7b mplayer-1.0_pre4-r5.ebuild 13407
MD5 071a354aa3c0e9290b6dcfc8c3621d87 mplayer-1.0_pre4.ebuild 11319
-MD5 8fd3c8b66040b26bb9f3963b5fe96bb2 mplayer-1.0_pre3-r3.ebuild 11498
-MD5 7eeb1235c1263ecb110925e53de1eb06 mplayer-1.0_pre2-r1.ebuild 11375
-MD5 fbdd96b2a3f0f78bdc8cbded3bb3927b mplayer-1.0_pre4-r2.ebuild 11948
-MD5 5d11f22039a718f19a725f676e614670 mplayer-1.0_pre3-r5.ebuild 11473
-MD5 d13f33f9022f7abccfe9b14f96531057 mplayer-1.0_pre4-r4.ebuild 13157
-MD5 b813a65769af5d2a2ca1ceba1347974d mplayer-0.92-r1.ebuild 11511
MD5 7a9a4dc1f6172ff55b3ed5bd975b0286 mplayer-1.0_pre5.ebuild 13255
-MD5 728891766b0363ef02adc8a5a0dbc5a9 ChangeLog 28702
-MD5 9ef4af14dad87b03fde8e43f19e08d26 metadata.xml 225
-MD5 1c2c6d32766ce3bf0974895533252491 mplayer-1.0_pre4-r1.ebuild 11659
-MD5 de75e0ec0e927ea7d09be97049bf5b0b mplayer-1.0_pre4-r5.ebuild 13286
-MD5 aaadaff9756ff85c9855b2bbd50da184 files/mplayer-1.0_pre4-gcc34-mtune.patch 3493
-MD5 5cc95d6b380dc27e5ceae0f53ab88f99 files/mplayer-1.0_pre5-mga-kernel-2.6.patch 15043
-MD5 deb1dbbf5879ed31e1b83fb7def5b600 files/digest-mplayer-0.92-r1 355
-MD5 a39bd930af792269808dc4bdbc382fbb files/mplayer-1.0_pre4-altivec-gcc34.patch 650
-MD5 059e03d1d2c965b04a5e53ed850de64a files/mplayer-0.90_rc4-gtk2.patch 6183
-MD5 98c7d58f544829621b15427ad53b98e4 files/mga-kernel-2.6.patch 16767
-MD5 e2fc2cbbc8ebf183dcb599b66c999331 files/ppc750FX-fix.patch 515
-MD5 260489267a0ccf01fe300bce0ec1430d files/mencoder-segfault.patch 520
+MD5 d13f33f9022f7abccfe9b14f96531057 mplayer-1.0_pre4-r4.ebuild 13157
+MD5 1f9260386b063367f192b6d5d65d6aea files/real_demux.patch 3107
MD5 6c2dab3392aab51766253b416ad2a10c files/default-skin.diff 396
-MD5 a71fc9832d953424652af1125fb7ea64 files/mplayer-0.90-coreutils-fixup.patch 1857
-MD5 d7d214ab46189ad1138a0a37eaa859d4 files/noenca.patch 289
-MD5 a9fa1b94e4e3842e2c5e552644b03eaa files/mplayer-1.0_pre3-alsa-gcc34.patch 299
-MD5 fef9f0571da54ae3df2e804100bd2632 files/vuln01-fix.diff 1231
-MD5 c2d65649f15837c5a326557ded4e47c5 files/mplayer.desktop 119
-MD5 8b8084aa31b466c55d15bd06bb77086d files/mplayer-1.0_pre3-xmms.patch 411
-MD5 dc67207241f6a950a4d529557ebd4053 files/digest-mplayer-1.0_pre4 358
-MD5 3aabe241ce3c7d60ea6f607cb7ab033a files/digest-mplayer-1.0_pre5 358
-MD5 c54c7ba8e18c8e7f3412c6d6939d010a files/mplayer-1.0-gtk2.patch 5903
-MD5 ad254e1f8a5166ae1c5b53bc3c76ffd2 files/mplayer-1.0_pre5-yuv2rbg_kludge.patch 12585
-MD5 26a52f084f4d177580ed9ea0187f54e7 files/mplayer-0.90-ppc-benh-2.patch 2049
-MD5 fa86dd9d6980ff064efcc9d9f919905e files/mplayer-1.0_pre3-libmatroska063.diff 810
-MD5 34f948b8f242a2aadb53a1e2b00e3155 files/vuln02-fix.diff 467
+MD5 deb1dbbf5879ed31e1b83fb7def5b600 files/digest-mplayer-0.92-r1 355
MD5 b0205104d1242fcccdb5dfd2188f5ab2 files/digest-mplayer-1.0_pre2-r1 358
MD5 d74f7136fa5b4fa7d9ef13f8193dfe7c files/digest-mplayer-1.0_pre3-r3 358
MD5 d74f7136fa5b4fa7d9ef13f8193dfe7c files/digest-mplayer-1.0_pre3-r4 358
MD5 d74f7136fa5b4fa7d9ef13f8193dfe7c files/digest-mplayer-1.0_pre3-r5 358
+MD5 dc67207241f6a950a4d529557ebd4053 files/digest-mplayer-1.0_pre4 358
MD5 dc67207241f6a950a4d529557ebd4053 files/digest-mplayer-1.0_pre4-r1 358
MD5 dc67207241f6a950a4d529557ebd4053 files/digest-mplayer-1.0_pre4-r2 358
MD5 dc67207241f6a950a4d529557ebd4053 files/digest-mplayer-1.0_pre4-r3 358
MD5 e4581f6934f66ccecc8c1682664623d0 files/digest-mplayer-1.0_pre4-r4 358
+MD5 3aabe241ce3c7d60ea6f607cb7ab033a files/digest-mplayer-1.0_pre5 358
+MD5 260489267a0ccf01fe300bce0ec1430d files/mencoder-segfault.patch 520
+MD5 98c7d58f544829621b15427ad53b98e4 files/mga-kernel-2.6.patch 16767
+MD5 a71fc9832d953424652af1125fb7ea64 files/mplayer-0.90-coreutils-fixup.patch 1857
+MD5 8f18911adcd661e70ad0cd84a94d49ac files/mplayer-0.90-divx.patch 25064
+MD5 26a52f084f4d177580ed9ea0187f54e7 files/mplayer-0.90-ppc-benh-2.patch 2049
+MD5 059e03d1d2c965b04a5e53ed850de64a files/mplayer-0.90_rc4-gtk2.patch 6183
+MD5 c54c7ba8e18c8e7f3412c6d6939d010a files/mplayer-1.0-gtk2.patch 5903
+MD5 a9fa1b94e4e3842e2c5e552644b03eaa files/mplayer-1.0_pre3-alsa-gcc34.patch 299
+MD5 f998f1cad3da27cac3aea1982dc5c747 files/mplayer-1.0_pre3-libavcodec-gcc34.patch 5010
+MD5 fa86dd9d6980ff064efcc9d9f919905e files/mplayer-1.0_pre3-libmatroska063.diff 810
+MD5 8b8084aa31b466c55d15bd06bb77086d files/mplayer-1.0_pre3-xmms.patch 411
MD5 a9fa1b94e4e3842e2c5e552644b03eaa files/mplayer-1.0_pre4-alsa-gcc34.patch 299
+MD5 a39bd930af792269808dc4bdbc382fbb files/mplayer-1.0_pre4-altivec-gcc34.patch 650
+MD5 aaadaff9756ff85c9855b2bbd50da184 files/mplayer-1.0_pre4-gcc34-mtune.patch 3493
MD5 42733acde24d84c1482db03c777360ab files/mplayer-1.0_pre4-help_mp-ro.h.patch 3267
-MD5 f998f1cad3da27cac3aea1982dc5c747 files/mplayer-1.0_pre3-libavcodec-gcc34.patch 5010
-MD5 8f18911adcd661e70ad0cd84a94d49ac files/mplayer-0.90-divx.patch 25064
-MD5 084f1aa4fbe48d34c3154d5a4f238579 files/amd64_fix_the_blue_love.patch 17751
+MD5 5cc95d6b380dc27e5ceae0f53ab88f99 files/mplayer-1.0_pre5-mga-kernel-2.6.patch 15043
+MD5 ad254e1f8a5166ae1c5b53bc3c76ffd2 files/mplayer-1.0_pre5-yuv2rbg_kludge.patch 12585
+MD5 c2d65649f15837c5a326557ded4e47c5 files/mplayer.desktop 119
+MD5 d7d214ab46189ad1138a0a37eaa859d4 files/noenca.patch 289
+MD5 e2fc2cbbc8ebf183dcb599b66c999331 files/ppc750FX-fix.patch 515
+MD5 fef9f0571da54ae3df2e804100bd2632 files/vuln01-fix.diff 1231
+MD5 34f948b8f242a2aadb53a1e2b00e3155 files/vuln02-fix.diff 467
MD5 e4581f6934f66ccecc8c1682664623d0 files/digest-mplayer-1.0_pre4-r5 358
-MD5 1f9260386b063367f192b6d5d65d6aea files/real_demux.patch 3107
+MD5 c39b2e0baa9cc24d22b62765776426ad files/str_undefined.patch 1845
+MD5 e614f6546020b77ced4ba12c36e5b51e files/strl.c 950
+MD5 7d81475ff0d1ba01de3b714d6dcc4891 files/gui_vuln_code.patch 17981
+MD5 084f1aa4fbe48d34c3154d5a4f238579 files/amd64_fix_the_blue_love.patch 17751
diff --git a/media-video/mplayer/files/gui_vuln_code.patch b/media-video/mplayer/files/gui_vuln_code.patch
new file mode 100644
index 000000000000..69bf0c801c87
--- /dev/null
+++ b/media-video/mplayer/files/gui_vuln_code.patch
@@ -0,0 +1,417 @@
+diff -Naur MPlayer-1.0pre4/Gui/Makefile MPlayer-1.0pre5/Gui/Makefile
+--- MPlayer-1.0pre4/Gui/Makefile 2003-04-05 00:39:51.000000000 +0900
++++ MPlayer-1.0pre5/Gui/Makefile 2004-06-28 04:17:24.000000000 +0900
+@@ -27,11 +27,12 @@
+ $(LIB): .depend $(OBJS)
+ rm -f $(LIB)
+ $(AR) rc $(LIB) $(OBJS) $(MPLAYEROBJS)
++ $(RANLIB) $(LIB)
+
+ all: $(LIB)
+
+ clean:
+- rm -rf $(OBJS) *.o *~ *.bak main $(PRG) $(LIB) .depend
++ rm -rf $(OBJS) *.o *~ *.bak main $(LIB) .depend
+
+ #dep: depend
+ #
+diff -Naur MPlayer-1.0pre4/Gui/interface.c MPlayer-1.0pre5/Gui/interface.c
+--- MPlayer-1.0pre4/Gui/interface.c 2004-03-26 06:49:47.000000000 +0900
++++ MPlayer-1.0pre5/Gui/interface.c 2004-06-26 22:26:10.000000000 +0900
+@@ -54,8 +56,12 @@
+ if ( *dest )
+ {
+ tmp=malloc( strlen( *dest ) + strlen( src ) + 1 );
+- strcpy( tmp,*dest ); strcat( tmp,src ); free( *dest );
+- }
++
++ if ( tmp ) /* TODO: advanced error handling */
++ {
++ strcpy( tmp,*dest ); strcat( tmp,src ); free( *dest );
++ }
++ }
+ else
+ { tmp=malloc( strlen( src ) + 1 ); strcpy( tmp,src ); }
+ *dest=tmp;
+diff -Naur MPlayer-1.0pre4/Gui/mplayer/common.c MPlayer-1.0pre5/Gui/mplayer/common.c
+--- MPlayer-1.0pre4/Gui/mplayer/common.c 2003-03-20 21:42:09.000000000 +0900
++++ MPlayer-1.0pre5/Gui/mplayer/common.c 2004-06-26 22:54:20.000000000 +0900
+@@ -30,37 +30,41 @@
+ #include "play.h"
+ #include "widgets.h"
+
+ extern unsigned int GetTimerMS( void );
+
+-inline void TranslateFilename( int c,char * tmp )
++inline void TranslateFilename( int c,char * tmp,size_t tmplen )
+ {
+ int i;
++ char * p;
++
+ switch ( guiIntfStruct.StreamType )
+ {
+ case STREAMTYPE_STREAM:
+- strcpy( tmp,guiIntfStruct.Filename );
++ strlcpy(tmp, guiIntfStruct.Filename, tmplen);
+ break;
+ case STREAMTYPE_FILE:
+ if ( ( guiIntfStruct.Filename )&&( guiIntfStruct.Filename[0] ) )
+ {
+- if ( strrchr( guiIntfStruct.Filename,'/' ) ) strcpy( tmp,strrchr( guiIntfStruct.Filename,'/' ) + 1 );
+- else strcpy( tmp,guiIntfStruct.Filename );
++ if ( p = strrchr(guiIntfStruct.Filename, '/') )
++ strlcpy(tmp, p + 1, tmplen);
++ else
++ strlcpy(tmp, guiIntfStruct.Filename, tmplen);
+ if ( tmp[strlen( tmp ) - 4] == '.' ) tmp[strlen( tmp ) - 4]=0;
+ if ( tmp[strlen( tmp ) - 5] == '.' ) tmp[strlen( tmp ) - 5]=0;
+- } else strcpy( tmp,MSGTR_NoFileLoaded );
++ } else strlcpy( tmp,MSGTR_NoFileLoaded,tmplen );
+ break;
+ #ifdef USE_DVDREAD
+ case STREAMTYPE_DVD:
+- if ( guiIntfStruct.DVD.current_chapter ) sprintf( tmp,MSGTR_Chapter,guiIntfStruct.DVD.current_chapter );
+- else strcat( tmp,MSGTR_NoChapter );
++ if ( guiIntfStruct.DVD.current_chapter ) snprintf(tmp,tmplen,MSGTR_Chapter,guiIntfStruct.DVD.current_chapter );
++ else strlcat( tmp,MSGTR_NoChapter,tmplen );
+ break;
+ #endif
+ #ifdef HAVE_VCD
+ case STREAMTYPE_VCD:
+- sprintf( tmp,MSGTR_VCDTrack,guiIntfStruct.Track );
++ snprintf( tmp,tmplen,MSGTR_VCDTrack,guiIntfStruct.Track );
+ break;
+ #endif
+- default: strcpy( tmp,MSGTR_NoMediaOpened );
++ default: strlcpy( tmp,MSGTR_NoMediaOpened,tmplen );
+ }
+ if ( c )
+ {
+@@ -74,75 +80,94 @@
+ }
+ }
+
++/* Unsafe! Pass only null-terminated strings as (char *)str. */
+ char * Translate( char * str )
+ {
+ static char trbuf[512];
+ char tmp[512];
+ int i,c;
+ int t;
++ int strsize = 0;
+ memset( trbuf,0,512 );
+ memset( tmp,0,128 );
+- for ( c=0,i=0;i < (int)strlen( str );i++ )
++ strsize = strlen(str);
++ for ( c=0,i=0;i < strsize;i++ )
+ {
+ if ( str[i] != '$' ) { trbuf[c++]=str[i]; trbuf[c]=0; }
+ else
+ {
+ switch ( str[++i] )
+ {
+- case 't': sprintf( tmp,"%02d",guiIntfStruct.Track ); strcat( trbuf,tmp ); break;
+- case 'o': TranslateFilename( 0,tmp ); strcat( trbuf,tmp ); break;
+- case 'f': TranslateFilename( 1,tmp ); strcat( trbuf,tmp ); break;
+- case 'F': TranslateFilename( 2,tmp ); strcat( trbuf,tmp ); break;
++ case 't': snprintf( tmp,sizeof( tmp ),"%02d",guiIntfStruct.Track );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case 'o': TranslateFilename( 0,tmp,sizeof( tmp ) );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case 'f': TranslateFilename( 1,tmp,sizeof( tmp ) );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case 'F': TranslateFilename( 2,tmp,sizeof( tmp ) );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
+ case '6': t=guiIntfStruct.LengthInSec; goto calclengthhhmmss;
+ case '1': t=guiIntfStruct.TimeSec;
+ calclengthhhmmss:
+- sprintf( tmp,"%02d:%02d:%02d",t/3600,t/60%60,t%60 ); strcat( trbuf,tmp );
++ snprintf( tmp,sizeof( tmp ),"%02d:%02d:%02d",t/3600,t/60%60,t%60 );
++ strlcat( trbuf,tmp,sizeof( trbuf ) );
+ break;
+ case '7': t=guiIntfStruct.LengthInSec; goto calclengthmmmmss;
+ case '2': t=guiIntfStruct.TimeSec;
+ calclengthmmmmss:
+- sprintf( tmp,"%04d:%02d",t/60,t%60 ); strcat( trbuf,tmp );
++ snprintf( tmp,sizeof( tmp ),"%04d:%02d",t/60,t%60 );
++ strlcat( trbuf,tmp,sizeof( trbuf ) );
+ break;
+- case '3': sprintf( tmp,"%02d",guiIntfStruct.TimeSec / 3600 ); strcat( trbuf,tmp ); break;
+- case '4': sprintf( tmp,"%02d",( ( guiIntfStruct.TimeSec / 60 ) % 60 ) ); strcat( trbuf,tmp ); break;
+- case '5': sprintf( tmp,"%02d",guiIntfStruct.TimeSec % 60 ); strcat( trbuf,tmp ); break;
+- case '8': sprintf( tmp,"%01d:%02d:%02d",guiIntfStruct.TimeSec / 3600,( guiIntfStruct.TimeSec / 60 ) % 60,guiIntfStruct.TimeSec % 60 ); strcat( trbuf,tmp ); break;
+- case 'v': sprintf( tmp,"%3.2f%%",guiIntfStruct.Volume ); strcat( trbuf,tmp ); break;
+- case 'V': sprintf( tmp,"%3.1f",guiIntfStruct.Volume ); strcat( trbuf,tmp ); break;
+- case 'b': sprintf( tmp,"%3.2f%%",guiIntfStruct.Balance ); strcat( trbuf,tmp ); break;
+- case 'B': sprintf( tmp,"%3.1f",guiIntfStruct.Balance ); strcat( trbuf,tmp ); break;
+- case 'd': sprintf( tmp,"%d",guiIntfStruct.FrameDrop ); strcat( trbuf,tmp ); break;
+- case 'x': sprintf( tmp,"%d",guiIntfStruct.MovieWidth ); strcat( trbuf,tmp ); break;
+- case 'y': sprintf( tmp,"%d",guiIntfStruct.MovieHeight ); strcat( trbuf,tmp ); break;
+- case 'C': sprintf( tmp,"%s", guiIntfStruct.sh_video? ((sh_video_t *)guiIntfStruct.sh_video)->codec->name : "");
+- strcat( trbuf,tmp ); break;
+- case 's': if ( guiIntfStruct.Playing == 0 ) strcat( trbuf,"s" ); break;
+- case 'l': if ( guiIntfStruct.Playing == 1 ) strcat( trbuf,"p" ); break;
+- case 'e': if ( guiIntfStruct.Playing == 2 ) strcat( trbuf,"e" ); break;
++ case '3': snprintf( tmp,sizeof( tmp ),"%02d",guiIntfStruct.TimeSec / 3600 );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case '4': snprintf( tmp,sizeof( tmp ),"%02d",( ( guiIntfStruct.TimeSec / 60 ) % 60 ) );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case '5': snprintf( tmp,sizeof( tmp ),"%02d",guiIntfStruct.TimeSec % 60 );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case '8': snprintf( tmp,sizeof( tmp ),"%01d:%02d:%02d",guiIntfStruct.TimeSec / 3600,( guiIntfStruct.TimeSec / 60 ) % 60,guiIntfStruct.TimeSec % 60 ); strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case 'v': snprintf( tmp,sizeof( tmp ),"%3.2f%%",guiIntfStruct.Volume );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case 'V': snprintf( tmp,sizeof( tmp ),"%3.1f",guiIntfStruct.Volume );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case 'b': snprintf( tmp,sizeof( tmp ),"%3.2f%%",guiIntfStruct.Balance );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case 'B': snprintf( tmp,sizeof( tmp ),"%3.1f",guiIntfStruct.Balance );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case 'd': snprintf( tmp,sizeof( tmp ),"%d",guiIntfStruct.FrameDrop );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case 'x': snprintf( tmp,sizeof( tmp ),"%d",guiIntfStruct.MovieWidth );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case 'y': snprintf( tmp,sizeof( tmp ),"%d",guiIntfStruct.MovieHeight );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case 'C': snprintf( tmp,sizeof( tmp ),"%s", guiIntfStruct.sh_video? ((sh_video_t *)guiIntfStruct.sh_video)->codec->name : "");
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case 's': if ( guiIntfStruct.Playing == 0 ) strlcat( trbuf,"s",sizeof( trbuf ) ); break;
++ case 'l': if ( guiIntfStruct.Playing == 1 ) strlcat( trbuf,"p",sizeof( trbuf ) ); break;
++ case 'e': if ( guiIntfStruct.Playing == 2 ) strlcat( trbuf,"e",sizeof( trbuf ) ); break;
+ case 'a':
+- if ( muted ) { strcat( trbuf,"n" ); break; }
++ if ( muted ) { strlcat( trbuf,"n",sizeof( trbuf ) ); break; }
+ switch ( guiIntfStruct.AudioType )
+ {
+- case 0: strcat( trbuf,"n" ); break;
+- case 1: strcat( trbuf,"m" ); break;
+- case 2: strcat( trbuf,"t" ); break;
++ case 0: strlcat( trbuf,"n",sizeof( trbuf ) ); break;
++ case 1: strlcat( trbuf,"m",sizeof( trbuf ) ); break;
++ case 2: strlcat( trbuf,"t",sizeof( trbuf ) ); break;
+ }
+ break;
+ case 'T':
+ switch ( guiIntfStruct.StreamType )
+ {
+- case STREAMTYPE_FILE: strcat( trbuf,"f" ); break;
++ case STREAMTYPE_FILE: strlcat( trbuf,"f",sizeof( trbuf ) ); break;
+ #ifdef HAVE_VCD
+- case STREAMTYPE_VCD: strcat( trbuf,"v" ); break;
++ case STREAMTYPE_VCD: strlcat( trbuf,"v",sizeof( trbuf ) ); break;
+ #endif
+- case STREAMTYPE_STREAM: strcat( trbuf,"u" ); break;
++ case STREAMTYPE_STREAM: strlcat( trbuf,"u",sizeof( trbuf ) ); break;
+ #ifdef USE_DVDREAD
+- case STREAMTYPE_DVD: strcat( trbuf,"d" ); break;
++ case STREAMTYPE_DVD: strlcat( trbuf,"d",sizeof( trbuf ) ); break;
+ #endif
+- default: strcat( trbuf," " ); break;
++ default: strlcat( trbuf," ",sizeof( trbuf ) ); break;
+ }
+ break;
+- case '$': strcat( trbuf,"$" ); break;
++ case '$': strlcat( trbuf,"$",sizeof( trbuf ) ); break;
+ default: continue;
+ }
+ c=strlen( trbuf );
+diff -Naur MPlayer-1.0pre4/Gui/mplayer/gtk/about.c MPlayer-1.0pre5/Gui/mplayer/gtk/about.c
+--- MPlayer-1.0pre4/Gui/mplayer/gtk/about.c 2003-03-17 09:48:26.000000000 +0900
++++ MPlayer-1.0pre5/Gui/mplayer/gtk/about.c 2004-06-15 19:52:36.000000000 +0900
+@@ -105,7 +105,6 @@
+ " * Bertrand Baudet\n"
+ " * Derek J Witt\n"
+ " * Artur Zaprzala\n"
+- " * lanzz@lanzz.org\n"
+ " * Adam Tla/lka\n"
+ " * Folke Ashberg\n"
+ " * Kamil-"
+diff -Naur MPlayer-1.0pre4/Gui/skin/skin.c MPlayer-1.0pre5/Gui/skin/skin.c
+--- MPlayer-1.0pre4/Gui/skin/skin.c 2003-06-04 02:36:25.000000000 +0900
++++ MPlayer-1.0pre5/Gui/skin/skin.c 2004-06-26 01:49:52.000000000 +0900
+@@ -116,7 +116,7 @@
+ {
+ CHECKDEFLIST( "window" );
+
+- strcpy( window_name,strlower( in ) );
++ strlcpy( window_name,strlower( in ),sizeof( window_name ) );
+ if ( !strncmp( in,"main",4 ) ) { currSection=&skinAppMPlayer->main; currSubItem=&skinAppMPlayer->NumberOfItems; currSubItems=skinAppMPlayer->Items; }
+ else if ( !strncmp( in,"sub",3 ) ) currSection=&skinAppMPlayer->sub;
+ else if ( !strncmp( in,"playbar",7 ) ) { currSection=&skinAppMPlayer->bar; currSubItem=&skinAppMPlayer->NumberOfBarItems; currSubItems=skinAppMPlayer->barItems; }
+@@ -147,7 +147,7 @@
+ defList->main.x=x;
+ defList->main.y=y;
+ defList->main.type=itBase;
+- strcpy( tmp,path ); strcat( tmp,fname );
++ strlcpy(tmp, path, sizeof( tmp )); strlcat(tmp, fname, sizeof( tmp ));
+ if ( skinBPRead( tmp,&defList->main.Bitmap ) ) return 1;
+ defList->main.width=defList->main.Bitmap.Width;
+ defList->main.height=defList->main.Bitmap.Height;
+@@ -162,7 +162,7 @@
+ if ( !strcmp( window_name,"sub" ) )
+ {
+ defList->sub.type=itBase;
+- strcpy( tmp,path ); strcat( tmp,fname );
++ strlcpy(tmp, path, sizeof( tmp )); strlcat(tmp, fname, sizeof( tmp ));
+ if ( skinBPRead( tmp,&defList->sub.Bitmap ) ) return 1;
+ defList->sub.x=x;
+ defList->sub.y=y;
+@@ -179,7 +179,7 @@
+ {
+ defList->menuIsPresent=1;
+ defList->menuBase.type=itBase;
+- strcpy( tmp,path ); strcat( tmp,fname );
++ strlcpy(tmp, path, sizeof( tmp )); strlcat(tmp, fname, sizeof( tmp ));
+ if ( skinBPRead( tmp,&defList->menuBase.Bitmap ) ) return 1;
+ defList->menuBase.width=defList->menuBase.Bitmap.Width;
+ defList->menuBase.height=defList->menuBase.Bitmap.Height;
+@@ -197,7 +197,7 @@
+ defList->bar.x=x;
+ defList->bar.y=y;
+ defList->bar.type=itBase;
+- strcpy( tmp,path ); strcat( tmp,fname );
++ strlcpy(tmp, path, sizeof( tmp )); strlcat(tmp, fname, sizeof( tmp ));
+ if ( skinBPRead( tmp,&defList->bar.Bitmap ) ) return 1;
+ defList->bar.width=defList->bar.Bitmap.Width;
+ defList->bar.height=defList->bar.Bitmap.Height;
+@@ -268,7 +268,7 @@
+ currSubItems[ *currSubItem ].Bitmap.Image=NULL;
+ if ( strcmp( fname,"NULL" ) )
+ {
+- strcpy( tmp,path ); strcat( tmp,fname );
++ strlcpy(tmp, path, sizeof( tmp )); strlcat(tmp, fname, sizeof( tmp ));
+ if ( skinBPRead( tmp,&currSubItems[ *currSubItem ].Bitmap ) ) return 1;
+ }
+
+@@ -289,7 +289,7 @@
+
+ cutItem( in,fname,',',0 );
+ defList->menuSelected.type=itBase;
+- strcpy( tmp,path ); strcat( tmp,fname );
++ strlcpy(tmp, path, sizeof( tmp )); strlcat(tmp, fname, sizeof( tmp ));
+ mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"\n[skin] selected: %s\n",fname );
+ if ( skinBPRead( tmp,&defList->menuSelected.Bitmap ) ) return 1;
+ defList->menuSelected.width=defList->menuSelected.Bitmap.Width;
+@@ -381,14 +381,14 @@
+ item->Bitmap.Image=NULL;
+ if ( strcmp( phfname,"NULL" ) )
+ {
+- strcpy( tmp,path ); strcat( tmp,phfname );
++ strlcpy(tmp, path, sizeof( tmp )); strlcat(tmp, phfname, sizeof( tmp ));
+ if ( skinBPRead( tmp,&item->Bitmap ) ) return 1;
+ }
+
+ item->Mask.Image=NULL;
+ if ( strcmp( pfname,"NULL" ) )
+ {
+- strcpy( tmp,path ); strcat( tmp,pfname );
++ strlcpy(tmp, path, sizeof( tmp )); strlcat(tmp, pfname, sizeof( tmp ));
+ if ( skinBPRead( tmp,&item->Mask ) ) return 1;
+ }
+ return 0;
+@@ -445,7 +445,7 @@
+ item->Bitmap.Image=NULL;
+ if ( strcmp( phfname,"NULL" ) )
+ {
+- strcpy( tmp,path ); strcat( tmp,phfname );
++ strlcpy(tmp, path, sizeof( tmp )); strlcat(tmp, phfname, sizeof( tmp ));
+ if ( skinBPRead( tmp,&item->Bitmap ) ) return 1;
+ }
+ return 0;
+@@ -655,7 +655,12 @@
+ FILE * skinFile;
+ XFlush( wsDisplay );
+
+ void setname( char * item1, char * item2 )
+-{ strcpy( fn,item1 ); strcat( fn,"/" ); strcat( fn,item2 ); strcpy( path,fn ); strcat( path,"/" ); strcat( fn,"/skin" ); }
++{
++ strlcpy(fn, item1, sizeof( fn ));
++ strlcat(fn, "/", sizeof( fn )); strlcat(fn, item2, sizeof( fn ));
++ strlcpy(path, fn, sizeof( path )); strlcat(path, "/", sizeof( path ));
++ strlcat(fn, "/skin", sizeof( fn ));
++}
+
+ int skinRead( char * dname )
+ {
+diff -Naur MPlayer-1.0pre4/Gui/wm/wm.c MPlayer-1.0pre5/Gui/wm/wm.c
+--- MPlayer-1.0pre4/Gui/wm/ws.c 2004-06-25 11:19:47.095450056 +0900
++++ MPlayer-1.0pre5/Gui/wm/ws.c 2004-06-25 11:23:47.593888736 +0900
+@@ -763,6 +763,7 @@
+ #ifdef ENABLE_DPMS
+ wsScreenSaverOn( wsDisplay );
+ #endif
++ vo_x11_ewmh_fullscreen( 0 ); // removes fullscreen state to be added if wm supports EWMH
+ }
+ else
+ {
+@@ -774,6 +775,7 @@
+ #ifdef ENABLE_DPMS
+ wsScreenSaverOff( wsDisplay );
+ #endif
++ vo_x11_ewmh_fullscreen( 1 ); // sends fullscreen state to be added if wm supports EWMH
+ }
+
+ vo_x11_decoration( wsDisplay,win->WindowID,decoration );
+diff -Naur MPlayer-1.0pre4/libvo/x11_common.c MPlayer-1.0pre5/Gui/libvo/x11_common.c
+--- MPlayer-1.0pre4/libvo/x11_common.c 2004-06-25 11:24:39.212041584 +0900
++++ MPlayer-1.0pre5/libvo/x11_common.c 2004-06-25 11:31:05.225358640 +0900
+@@ -117,6 +117,43 @@
+
+ static int vo_x11_get_fs_type(int supported);
+
++/*
++ * Sends the EWMH fullscreen state event.
++ *
++ * action: could be on of 0 -- remove state
++ * 1 -- add state
++ * 2 -- toggle
++ */
++void vo_x11_ewmh_fullscreen( int action )
++{
++ if ( vo_fs_type & vo_wm_FULLSCREEN )
++ {
++ XEvent xev;
++
++ /* init X event structure for _NET_WM_FULLSCREEN client msg */
++ xev.xclient.type = ClientMessage;
++ xev.xclient.serial = 0;
++ xev.xclient.send_event = True;
++ xev.xclient.message_type = XInternAtom( mDisplay,
++ "_NET_WM_STATE", False );
++ xev.xclient.window = vo_window;
++ xev.xclient.format = 32;
++ xev.xclient.data.l[0] = action;
++ xev.xclient.data.l[1] = XInternAtom( mDisplay,
++ "_NET_WM_STATE_FULLSCREEN", False );
++ xev.xclient.data.l[2] = 0;
++ xev.xclient.data.l[3] = 0;
++ xev.xclient.data.l[4] = 0;
++
++ /* finally send that damn thing */
++ if ( !XSendEvent( mDisplay, DefaultRootWindow( mDisplay ), False,
++ SubstructureRedirectMask | SubstructureNotifyMask, &xev ) )
++ {
++ mp_msg( MSGT_VO,MSGL_ERR, "\nX11: Couldn't send EWMH fullscreen Event!\n" );
++ }
++ }
++}
++
+ void vo_hidecursor ( Display *disp , Window win )
+ {
+ Cursor no_ptr;
+@@ -1062,11 +1099,15 @@
+
+ if ( vo_fs ){
+ // fs->win
++ vo_x11_ewmh_fullscreen( 0 ); // removes fullscreen state if wm supports EWMH
++
+ if(vo_dwidth != vo_screenwidth && vo_dheight != vo_screenheight) return;
+ vo_fs=VO_FALSE;
+ x=vo_old_x; y=vo_old_y; w=vo_old_width; h=vo_old_height;
+ } else {
+ // win->fs
++ vo_x11_ewmh_fullscreen( 1 ); // sends fullscreen state to be added if wm supports EWMH
++
+ if(vo_old_width &&
+ (vo_dwidth==vo_screenwidth && vo_dwidth!=vo_old_width) &&
+ (vo_dheight==vo_screenheight && vo_dheight!=vo_old_height) ) return;
diff --git a/media-video/mplayer/files/str_undefined.patch b/media-video/mplayer/files/str_undefined.patch
new file mode 100644
index 000000000000..58e252676ab8
--- /dev/null
+++ b/media-video/mplayer/files/str_undefined.patch
@@ -0,0 +1,68 @@
+--- MPlayer-1.0pre4/configure 2004-04-26 18:44:06.000000000 +0900
++++ MPlayer-1.0pre5/configure 2004-07-15 07:04:42.000000000 +0900
+@@ -2649,6 +2766,34 @@
+ fi
+ echores "$_strsep"
+
++echocheck "strlcpy()"
++cat > $TMPC << EOF
++#include <string.h>
++int main (void) { char *s = "Hello, world!", t[20]; (void) strlcpy(t, s, sizeof( t )); return 0; }
++EOF
++_strlcpy=no
++cc_check && _strlcpy=yes
++if test "$_strlcpy" = yes ; then
++ _def_strlcpy='#define HAVE_STRLCPY 1'
++else
++ _def_strlcpy='#undef HAVE_STRLCPY'
++fi
++echores "$_strlcpy"
++
++echocheck "strlcat()"
++cat > $TMPC << EOF
++#include <string.h>
++int main (void) { char *s = "Hello, world!", t[20]; (void) strlcat(t, s, sizeof( t )); return 0; }
++EOF
++_strlcat=no
++cc_check && _strlcat=yes
++if test "$_strlcat" = yes ; then
++ _def_strlcat='#define HAVE_STRLCAT 1'
++else
++ _def_strlcat='#undef HAVE_STRLCAT'
++fi
++echores "$_strlcat"
++
+ echocheck "fseeko()"
+ cat > $TMPC << EOF
+ #include <stdio.h>
+@@ -6272,6 +6448,18 @@
+ /* Define this if your system has strsep */
+ $_def_strsep
+
++/* Define this if your system has strlcpy */
++$_def_strlcpy
++#ifndef HAVE_STRLCPY
++unsigned int strlcpy (char *dest, char *src, unsigned int size);
++#endif
++
++/* Define this if your system has strlcat */
++$_def_strlcat
++#ifndef HAVE_STRLCAT
++unsigned int strlcat (char *dest, char *src, unsigned int size);
++#endif
++
+ /* Define this if your system has fseeko */
+ $_def_fseeko
+ #ifndef HAVE_FSEEKO
+--- MPlayer-1.0pre4/osdep/Makefile 2004-03-27 00:21:44.000000000 +0900
++++ MPlayer-1.0pre5/osdep/Makefile 2004-06-28 02:54:31.000000000 +0900
+@@ -3,7 +3,8 @@
+
+ LIBNAME = libosdep.a
+
+-SRCS= shmem.c strsep.c vsscanf.c scandir.c gettimeofday.c fseeko.c # timer.c
++SRCS= shmem.c strsep.c strl.c vsscanf.c scandir.c gettimeofday.c fseeko.c \
++ # timer.c
+
+ ifeq ($(TARGET_ARCH_X86),yes)
+ ifeq ($(TARGET_OS),Linux)
diff --git a/media-video/mplayer/files/strl.c b/media-video/mplayer/files/strl.c
new file mode 100644
index 000000000000..22e4cb56c307
--- /dev/null
+++ b/media-video/mplayer/files/strl.c
@@ -0,0 +1,47 @@
+/* strl(cat|cpy) implementation for systems that do not have it in libc */
+/* strl.c - strlcpy/strlcat implementation
+ * Time-stamp: <2004-03-14 njk>
+ * (C) 2003-2004 Nicholas J. Kain <njk@aerifal.cx>
+ */
+
+#include "../config.h"
+
+#ifndef HAVE_STRLCPY
+unsigned int strlcpy (char *dest, char *src, unsigned int size)
+{
+ register unsigned int i;
+
+ for (i=0; size > 0 && src[i] != '\0'; ++i, size--)
+ dest[i] = src[i];
+
+ dest[i] = '\0';
+
+ return i;
+}
+#endif
+
+#ifndef HAVE_STRLCAT
+unsigned int strlcat (char *dest, char *src, unsigned int size)
+{
+#if 0
+ register unsigned int i, j;
+
+ for(i=0; size > 0 && dest[i] != '\0'; size--, i++);
+ for(j=0; size > 0 && src[j] != '\0'; size--, i++, j++)
+ dest[i] = src[j];
+
+ dest[i] = '\0';
+ return i;
+#else
+ register char *d = dest, *s = src;
+
+ for (; size > 0 && *d != '\0'; size--, d++);
+ for (; size > 0 && *s != '\0'; size--, d++, s++)
+ *d = *s;
+
+ *d = '\0';
+ return (d - dest) + (s - src);
+#endif
+}
+#endif
+
diff --git a/media-video/mplayer/mplayer-1.0_pre4-r5.ebuild b/media-video/mplayer/mplayer-1.0_pre4-r5.ebuild
index e87299fad6bd..071891e4de58 100644
--- a/media-video/mplayer/mplayer-1.0_pre4-r5.ebuild
+++ b/media-video/mplayer/mplayer-1.0_pre4-r5.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/mplayer/mplayer-1.0_pre4-r5.ebuild,v 1.2 2004/07/18 22:42:50 lv Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-video/mplayer/mplayer-1.0_pre4-r5.ebuild,v 1.3 2004/07/19 04:24:07 chriswhite Exp $
inherit eutils flag-o-matic kmod
@@ -107,8 +107,12 @@ src_unpack() {
cd ${S}
- # fixes bug #55456 for amd64
- use amd64 && epatch ${FILESDIR}/amd64_fix_the_blue_love.patch
+ # fixes bug #55456 for amd64 and fullscreen Bug #43010
+ epatch ${FILESDIR}/gui_vuln_code.patch
+
+ # fixes missing str* linking bugs
+ cp ${FILESDIR}/strl.c ${S}/osdep
+ epatch ${FILESDIR}/str_undefined.patch
# Fix head/tail call for new coreutils
epatch ${FILESDIR}/${PN}-0.90-coreutils-fixup.patch