From: Sebastian Rasmussen Date: Sat, 5 Jul 2014 23:55:16 +0000 (+0200) Subject: mpegts: Don't confuse slice allocator with regular one X-Git-Tag: 1.4.0~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=66c38b50f3ddd911eb5abd05e8095e438cadec78;p=platform%2Fupstream%2Fgst-plugins-bad.git mpegts: Don't confuse slice allocator with regular one Previously selector_bytes and private_data_bytes were sometimes allocated and free using the normal allocator and sometimes using the slice allocator. Additionally prefer g_strdup() to g_memdup() for strings. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=732789 --- diff --git a/gst-libs/gst/mpegts/gst-dvb-descriptor.c b/gst-libs/gst/mpegts/gst-dvb-descriptor.c index 94328b0..c1f2c30 100644 --- a/gst-libs/gst/mpegts/gst-dvb-descriptor.c +++ b/gst-libs/gst/mpegts/gst-dvb-descriptor.c @@ -554,8 +554,8 @@ _gst_mpegts_dvb_linkage_descriptor_copy (GstMpegtsDVBLinkageDescriptor * source) break; } - copy->private_data_bytes = g_slice_copy (source->private_data_length, - source->private_data_bytes); + copy->private_data_bytes = g_memdup (source->private_data_bytes, + source->private_data_length); return copy; } @@ -578,8 +578,7 @@ gst_mpegts_dvb_linkage_descriptor_free (GstMpegtsDVBLinkageDescriptor * source) break; } - if (source->private_data_bytes) - g_slice_free1 (source->private_data_length, source->private_data_bytes); + g_free (source->private_data_bytes); g_slice_free (GstMpegtsDVBLinkageDescriptor, source); } @@ -1023,7 +1022,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_strdup (source->text); return copy; } @@ -1906,7 +1905,7 @@ _gst_mpegts_dvb_data_broadcast_descriptor_copy (GstMpegtsDataBroadcastDescriptor copy = g_slice_dup (GstMpegtsDataBroadcastDescriptor, source); - copy->selector_bytes = g_slice_copy (source->length, source->selector_bytes); + copy->selector_bytes = g_memdup (source->selector_bytes, source->length); copy->language_code = g_strdup (source->language_code); copy->text = g_strdup (source->text);