From 3784de031dd4c6eaa3af94cf16c83e48df780264 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 27 Oct 2009 12:33:24 +0100 Subject: rmutils: fix byteswapping fix the byteswapping code that was wrong because of the side effects of the READ/WRITE macros. Fixes #599676 --- gst/realmedia/rmutils.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gst/realmedia') 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; -- cgit v1.2.3