mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
gst/: Fix potentially unaligned access (#397207).
Original commit message from CVS: * gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps): * gst-libs/gst/tag/gstvorbistag.c: (gst_tag_list_to_vorbiscomment_buffer): * gst/typefind/gsttypefindfunctions.c: (vorbis_type_find): Fix potentially unaligned access (#397207).
This commit is contained in:
parent
268dcb0ab1
commit
0eac623115
4 changed files with 21 additions and 9 deletions
|
@ -1,3 +1,11 @@
|
|||
2007-01-16 Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
||||
* gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps):
|
||||
* gst-libs/gst/tag/gstvorbistag.c:
|
||||
(gst_tag_list_to_vorbiscomment_buffer):
|
||||
* gst/typefind/gsttypefindfunctions.c: (vorbis_type_find):
|
||||
Fix potentially unaligned access (#397207).
|
||||
|
||||
2007-01-16 Stefan Kost <ensonic@users.sf.net>
|
||||
|
||||
* tests/examples/seek/seek.c: (set_scale), (update_scale),
|
||||
|
|
|
@ -631,12 +631,16 @@ gst_riff_create_video_caps (guint32 codec_fcc,
|
|||
GST_BUFFER_SIZE (palette));
|
||||
|
||||
#if (G_BYTE_ORDER == G_BIG_ENDIAN)
|
||||
gint n;
|
||||
guint32 *data = (guint32 *) GST_BUFFER_DATA (copy);
|
||||
{
|
||||
guint8 *data = GST_BUFFER_DATA (copy);
|
||||
gint n;
|
||||
|
||||
/* own endianness */
|
||||
for (n = 0; n < num_colors; n++)
|
||||
data[n] = GUINT32_FROM_LE (data[n]);
|
||||
/* own endianness */
|
||||
for (n = 0; n < num_colors; n++) {
|
||||
GST_WRITE_UINT32_BE (data, GST_READ_UINT32_LE (data));
|
||||
data += sizeof (guint32);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
gst_caps_set_simple (caps, "palette_data", GST_TYPE_BUFFER, copy, NULL);
|
||||
gst_buffer_unref (copy);
|
||||
|
|
|
@ -516,12 +516,12 @@ gst_tag_list_to_vorbiscomment_buffer (const GstTagList * list,
|
|||
memcpy (data, id_data, id_data_length);
|
||||
data += id_data_length;
|
||||
}
|
||||
*((guint32 *) data) = GUINT32_TO_LE (vendor_len);
|
||||
GST_WRITE_UINT32_LE (data, vendor_len);
|
||||
data += 4;
|
||||
memcpy (data, vendor_string, vendor_len);
|
||||
data += vendor_len;
|
||||
l = my_data.entries = g_list_reverse (my_data.entries);
|
||||
*((guint32 *) data) = GUINT32_TO_LE (my_data.count);
|
||||
GST_WRITE_UINT32_LE (data, my_data.count);
|
||||
data += 4;
|
||||
for (i = 0; i < my_data.count; i++) {
|
||||
guint size;
|
||||
|
@ -531,7 +531,7 @@ gst_tag_list_to_vorbiscomment_buffer (const GstTagList * list,
|
|||
cur = l->data;
|
||||
l = g_list_next (l);
|
||||
size = strlen (cur);
|
||||
*((guint32 *) data) = GUINT32_TO_LE (size);
|
||||
GST_WRITE_UINT32_LE (data, size);
|
||||
data += 4;
|
||||
memcpy (data, cur, size);
|
||||
data += size;
|
||||
|
|
|
@ -2104,7 +2104,7 @@ vorbis_type_find (GstTypeFind * tf, gpointer private)
|
|||
return;
|
||||
data++;
|
||||
/* 4 byte samplerate must be != 0 */
|
||||
if (*((guint32 *) data) == 0)
|
||||
if (GST_READ_UINT32_LE (data) == 0)
|
||||
return;
|
||||
data += 16;
|
||||
/* blocksize checks */
|
||||
|
|
Loading…
Reference in a new issue