[MPlayer-dev-eng] [PATCH] Startup crash on sparc64
Reimar Döffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Sat Jul 31 10:33:49 CEST 2004
Hi,
> 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)
You should have given a proper bugreport or at least the exact line,
because e.g. parse_flag and many others won't make problems as far as I
can see.
The problem should be with e.g. parse_str, line 345 as there VAL is
defined as (*(char **)), so that a pointer is written at the location
data, which as said is not properly aligned.
One possibility would be e.g. to change
unsigned char data[0];
to
unsigned char *data[0];
so that the compiler would properly align it. But this would break any
existing pointer arithmetic on data (and I'm quite sure there is some
somewhere ;-) )
So I suggest the solution used in the attached patch.
Please try if it works.
Greetings,
Reimar Döffinger
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: opt_align.diff
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20040731/27c78dcf/attachment.asc>
More information about the MPlayer-dev-eng
mailing list