[Bug 732789] mpegts: don't confuse slice allocator with regular allocator
GStreamer (bugzilla.gnome.org)
bugzilla at gnome.org
Sun Jul 6 14:49:18 PDT 2014
https://bugzilla.gnome.org/show_bug.cgi?id=732789
GStreamer | gst-plugins-bad | git
Tim-Philipp Müller <t.i.m> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #279969|none |reviewed
status| |
--- Comment #4 from Tim-Philipp Müller <t.i.m at zen.co.uk> 2014-07-06 21:49:12 UTC ---
(From update of attachment 279969)
>@@ -977,7 +977,7 @@ _gst_mpegts_extended_event_descriptor_copy (GstMpegtsExtendedEventDescriptor *
>
> copy = g_slice_dup (GstMpegtsExtendedEventDescriptor, source);
> copy->items = g_ptr_array_ref (source->items);
>- copy->text = g_slice_copy (sizeof (source->text), source->text);
>+ copy->text = g_memdup (source->text, strlen (source->text));
g_strdup() please.
>@@ -1870,7 +1870,7 @@ void
> gst_mpegts_dvb_data_broadcast_descriptor_free (GstMpegtsDataBroadcastDescriptor
> * source)
> {
>- g_free (source->selector_bytes);
>+ g_slice_free1 (source->length, source->selector_bytes);
> g_free (source->language_code);
> g_free (source->text);
> g_slice_free (GstMpegtsDataBroadcastDescriptor, source);
>@@ -1913,7 +1913,7 @@ gst_mpegts_descriptor_parse_dvb_data_broadcast (const GstMpegtsDescriptor
> res->length = *data;
> data += 1;
>
>- res->selector_bytes = g_memdup (data, res->length);
>+ res->selector_bytes = g_slice_copy (res->length, data);
> data += res->length;
I think here the g_slice_copy() should be changed to g_memdup() and these two
should be left alone. Generally I don't think we should use GSlice for random
chunks of memory, only structs or if we know that often chunks of the same size
are going to be allocated.
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the gstreamer-bugs
mailing list