gst/realmedia/rmdemux.c: Use alignment-safe macros here too (subbuffers ...); guard against hypothetical memory acces...
Original commit message from CVS: * gst/realmedia/rmdemux.c: (gst_rmdemux_descramble_dnet_audio): Use alignment-safe macros here too (subbuffers ...); guard against hypothetical memory access beyond our given buffer in the case where the buffer size is not a multiple of 2.
This commit is contained in:
parent
7e1371c41e
commit
334fdce1d0
@ -1,3 +1,10 @@
|
|||||||
|
2006-12-15 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
|
* gst/realmedia/rmdemux.c: (gst_rmdemux_descramble_dnet_audio):
|
||||||
|
Use alignment-safe macros here too (subbuffers ...); guard against
|
||||||
|
hypothetical memory access beyond our given buffer in the case
|
||||||
|
where the buffer size is not a multiple of 2.
|
||||||
|
|
||||||
2006-12-15 Tim-Philipp Müller <tim at centricular dot net>
|
2006-12-15 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
* gst/asfdemux/gstasfdemux.c: (gst_asf_demux_handle_seek_event),
|
* gst/asfdemux/gstasfdemux.c: (gst_asf_demux_handle_seek_event),
|
||||||
|
@ -1869,18 +1869,19 @@ gst_rmdemux_descramble_dnet_audio (GstRMDemux * rmdemux,
|
|||||||
GstRMDemuxStream * stream)
|
GstRMDemuxStream * stream)
|
||||||
{
|
{
|
||||||
GstBuffer *buf;
|
GstBuffer *buf;
|
||||||
guint16 *data, *end;
|
guint8 *data, *end;
|
||||||
|
|
||||||
buf = g_ptr_array_index (stream->subpackets, 0);
|
buf = g_ptr_array_index (stream->subpackets, 0);
|
||||||
g_ptr_array_index (stream->subpackets, 0) = NULL;
|
g_ptr_array_index (stream->subpackets, 0) = NULL;
|
||||||
g_ptr_array_set_size (stream->subpackets, 0);
|
g_ptr_array_set_size (stream->subpackets, 0);
|
||||||
|
|
||||||
/* descramble is a bit of a misnomer, it's just byte-order swapped AC3 .. */
|
/* descramble is a bit of a misnomer, it's just byte-order swapped AC3 .. */
|
||||||
data = (guint16 *) GST_BUFFER_DATA (buf);
|
data = GST_BUFFER_DATA (buf);
|
||||||
end = (guint16 *) (GST_BUFFER_DATA (buf) + GST_BUFFER_SIZE (buf));
|
end = GST_BUFFER_DATA (buf) + GST_BUFFER_SIZE (buf);
|
||||||
while (data < end) {
|
while ((data + 1) < end) {
|
||||||
*data = GUINT16_SWAP_LE_BE (*data);
|
/* byte-swap in an alignment-safe way */
|
||||||
++data;
|
GST_WRITE_UINT16_BE (data, GST_READ_UINT16_LE (data));
|
||||||
|
data += sizeof (guint16);
|
||||||
}
|
}
|
||||||
|
|
||||||
return gst_pad_push (stream->pad, buf);
|
return gst_pad_push (stream->pad, buf);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user