+2008-02-27 Sebastian Dröge <slomo@circular-chaos.org>
+
+ * gst-libs/gst/cdda/sha1.c: (sha_transform):
+ Use memcpy() instead of upcasting a byte array to long *. This
+ fixes an unaligned memory access, resulting in SIGBUS on IA64.
+ This should be ported to GCheckSum once we can use GLib 2.16.
+ Partially fixes bug #500833.
+
2008-02-27 Tim-Philipp Müller <tim at centricular dot net>
* gst-libs/gst/tag/gsttagdemux.c: (gst_tag_demux_chain):
#if (SHA_BYTE_ORDER == 1234)
#define SWAP_DONE
for (i = 0; i < 16; ++i) {
- T = *((SHA_LONG *) dp);
+ memcpy (&T, dp, sizeof (SHA_LONG));
dp += 4;
W[i] = ((T << 24) & 0xff000000) | ((T << 8) & 0x00ff0000) |
((T >> 8) & 0x0000ff00) | ((T >> 24) & 0x000000ff);
#if (SHA_BYTE_ORDER == 4321)
#define SWAP_DONE
for (i = 0; i < 16; ++i) {
- T = *((SHA_LONG *) dp);
+ memcpy (&T, dp, sizeof (SHA_LONG));
dp += 4;
W[i] = T32 (T);
}
#if (SHA_BYTE_ORDER == 12345678)
#define SWAP_DONE
for (i = 0; i < 16; i += 2) {
- T = *((SHA_LONG *) dp);
+ memcpy (&T, dp, sizeof (SHA_LONG));
dp += 8;
W[i] = ((T << 24) & 0xff000000) | ((T << 8) & 0x00ff0000) |
((T >> 8) & 0x0000ff00) | ((T >> 24) & 0x000000ff);
#if (SHA_BYTE_ORDER == 87654321)
#define SWAP_DONE
for (i = 0; i < 16; i += 2) {
- T = *((SHA_LONG *) dp);
+ memcpy (&T, dp, sizeof (SHA_LONG));
dp += 8;
W[i] = T32 (T >> 32);
W[i + 1] = T32 (T);