Hi, Can anyone familiar with data alignment issues on ARM give me some advice about this bug?: https://bugzilla.mozilla.org/show_bug.cgi?id=483912 The relevant code is in liboggz HEAD at: http://git.xiph.org/?p=liboggz.git;a=blob;f=src/liboggz/oggz_auto.c;h=ebb825c348298dc352a54d6925ce74ed707bbc3a;hb=HEAD#l138 cheers, Conrad.
Conrad Parker wrote:> The relevant code is in liboggz HEAD at: > > http://git.xiph.org/?p=liboggz.git;a=blob;f=src/liboggz/oggz_auto.c;h=ebb825c348298dc352a54d6925ce74ed707bbc3a;hb=HEAD#l138My suspicion is this: fps_numerator = INT32_BE_AT(&header[22]); Sure enough, INT32_BE_AT is defined as: #define INT32_BE_AT(x) _be_32((*(ogg_int32_t *)(x))) which will work fine as long as x in 4 byte aligned. I suspect that if INT32_BE_AT is defined as follows: static int32_t INT32_BE_AT (unsigned char *c) { return (c [0] << 24) + (c [1] << 16) + (c [2] << 8) + c [0] ; } then you won't see the problem. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
2009/5/4 Erik de Castro Lopo <mle+la at mega-nerd.com>:> Conrad Parker wrote: > >> The relevant code is in liboggz HEAD at: >> >> http://git.xiph.org/?p=liboggz.git;a=blob;f=src/liboggz/oggz_auto.c;h=ebb825c348298dc352a54d6925ce74ed707bbc3a;hb=HEAD#l138 > > My suspicion is this: > > ? ?fps_numerator = INT32_BE_AT(&header[22]); > > Sure enough, INT32_BE_AT is defined as: > > ? ?#define INT32_BE_AT(x) _be_32((*(ogg_int32_t *)(x))) > > which will work fine as long as x in 4 byte aligned. > > I suspect that if INT32_BE_AT is defined as follows: > > ? static int32_t > ? INT32_BE_AT (unsigned char *c) > ? { ? return (c [0] << ?24) + (c [1] << ?16) + (c [2] << ?8) + c [0] ; > ? } > > then you won't see the problem.great, thanks Erik: applied (351a85) with a function of that name in lowercase. Thanks also to Chris Pearce for the explanation over in the bug report :-) cheers, Conrad.