[MPlayer-dev-eng] [PATCH] segmentation violation in asfheader.c with solaris

Martin Olschewski olschewski at zpr.uni-koeln.de
Fri May 24 14:51:39 CEST 2002


Hi,

I could not play some asf-files on sparc/solaris because of a segmenta-
tion violation in libmpdemux/asfheader.c.  On the sun all int32 objects
have to be aligned on 32 bit boundaries.  With this patch the asf-files
run well on sparc/solaris and x86/linux (debian).  It is not tested on
other systems.

Best regards,

  Martin

-- 
Dipl.-Inform. Martin Olschewski 	Center for Applied Computer Science
Email: olschewski at zpr.uni-koeln.de	University of Cologne
Tel.:  ++49/221/470-6018		Weyertal 80
Fax.:  ++49/221/470-5160		D-50931 K\"oln
-------------- next part --------------
Index: libmpdemux/asfheader.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/asfheader.c,v
retrieving revision 1.31
diff -u -r1.31 asfheader.c
--- libmpdemux/asfheader.c	14 Apr 2002 05:53:36 -0000	1.31
+++ libmpdemux/asfheader.c	24 May 2002 12:45:10 -0000
@@ -301,7 +301,8 @@
         for( i=0 ; i<stream_count && ptr<((char*)object+objh.size) ; i++ ) {
           stream_id = le2me_16(*(uint16_t*)ptr);
           ptr += sizeof(uint16_t);
-          max_bitrate = le2me_32(*(uint32_t*)ptr);
+          memcpy(&max_bitrate, ptr, sizeof(uint32_t));
+          max_bitrate = le2me_32(max_bitrate);
           ptr += sizeof(uint32_t);
           printf("   stream id=[0x%x][%u]\n", stream_id, stream_id );
           printf("   max bitrate=[0x%x][%u]\n", max_bitrate, max_bitrate );


More information about the MPlayer-dev-eng mailing list