[MPlayer-dev-eng] [PATCH] Startup crash on sparc64

Julian Coleman jdc at coris.org.uk
Fri Jul 23 15:58:36 CEST 2004


In m_config.h, the `data' member of struct m_config_save_slot is aligned on a
4 byte boundary because it follows the `int lvl' member.  In the parse_*()
functions in m_option.c, the construction:

  if(dst) VAL(dst)

causes the address of `data' to be assigned to a pointer.  As pointers must
be aligned on an 8 byte boundary on sparc64, a bus error is generated at this
point.

The following patch (hack?) fixes this

J

  - - 8< - - - - - - - - - - - - - Cut here - - - - - - - - - - - - - >8 - -

--- m_config.h.orig     2003-08-13 17:29:00.000000000 +0100
+++ m_config.h  2004-07-23 10:37:29.000000000 +0100
@@ -9,7 +9,10 @@
 struct m_config_save_slot {
   m_config_save_slot_t* prev;
   int lvl;
-  unsigned char data[0];
+  union {
+    unsigned char data[0];
+    void* dummy;
+  };
 };
 
 struct m_config_option {

-- 
  My other computer also runs NetBSD    /        Sailing at Newbiggin
        http://www.netbsd.org/        /   http://www.newbigginsailingclub.org/




More information about the MPlayer-dev-eng mailing list