summaryrefslogtreecommitdiff
path: root/gst/realmedia
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2009-10-27 12:33:24 +0100
committerWim Taymans <wim.taymans@collabora.co.uk>2009-10-27 12:33:24 +0100
commit3784de031dd4c6eaa3af94cf16c83e48df780264 (patch)
tree8c2cf255b19f64078aaeb5afa3a7c9d887cf4c5f /gst/realmedia
parent0a36965808ab9095dd68541f589fd71b66c99ca7 (diff)
rmutils: fix byteswapping
fix the byteswapping code that was wrong because of the side effects of the READ/WRITE macros. Fixes #599676
Diffstat (limited to 'gst/realmedia')
-rw-r--r--gst/realmedia/rmutils.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gst/realmedia/rmutils.c b/gst/realmedia/rmutils.c
index 5d816698..9b52bd1d 100644
--- a/gst/realmedia/rmutils.c
+++ b/gst/realmedia/rmutils.c
@@ -124,7 +124,7 @@ gst_rm_utils_read_tags (const guint8 * data, guint datalen,
GstBuffer *
gst_rm_utils_descramble_dnet_buffer (GstBuffer * buf)
{
- guint8 *data, *end;
+ guint8 *data, *end, tmp;
buf = gst_buffer_make_writable (buf);
@@ -132,8 +132,10 @@ gst_rm_utils_descramble_dnet_buffer (GstBuffer * buf)
data = GST_BUFFER_DATA (buf);
end = GST_BUFFER_DATA (buf) + GST_BUFFER_SIZE (buf);
while ((data + 1) < end) {
- /* byte-swap in an alignment-safe way */
- GST_WRITE_UINT16_BE (data, GST_READ_UINT16_LE (data));
+ /* byte-swap */
+ tmp = data[0];
+ data[0] = data[1];
+ data[1] = tmp;
data += sizeof (guint16);
}
return buf;