Commit 07cd425c authored by Sebastian Dröge's avatar Sebastian Dröge
Browse files

gst-libs/gst/cdda/sha1.c: Use memcpy() instead of upcasting a byte array to...

gst-libs/gst/cdda/sha1.c: Use memcpy() instead of upcasting a byte array to long *. This fixes an unaligned memory ac...

Original commit message from CVS:
* 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.
parent b191c8f6
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):
......@@ -99,7 +99,7 @@ nether regions of the anatomy...
#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);
......@@ -109,7 +109,7 @@ nether regions of the anatomy...
#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);
}
......@@ -118,7 +118,7 @@ nether regions of the anatomy...
#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);
......@@ -131,7 +131,7 @@ nether regions of the anatomy...
#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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment