From: Seungha Yang Date: Thu, 1 Aug 2019 06:02:23 +0000 (+0900) Subject: qtdemux: Use empty-array safe way to cleanup GPtrArray X-Git-Tag: 1.19.3~509^2~923 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4146dc905d2b7b222d1b47fa900242819c679e79;p=platform%2Fupstream%2Fgstreamer.git qtdemux: Use empty-array safe way to cleanup GPtrArray Fix assertion fail GLib-CRITICAL **: g_ptr_array_remove_range: assertion 'index_ < rarray->len' failed --- diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index d8c434e6f5..6112f20acd 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -2174,10 +2174,8 @@ gst_qtdemux_reset (GstQTDemux * qtdemux, gboolean hard) if (hard) { qtdemux->segment_seqnum = GST_SEQNUM_INVALID; qtdemux->trickmode_interval = 0; - g_ptr_array_remove_range (qtdemux->active_streams, - 0, qtdemux->active_streams->len); - g_ptr_array_remove_range (qtdemux->old_streams, - 0, qtdemux->old_streams->len); + g_ptr_array_set_size (qtdemux->active_streams, 0); + g_ptr_array_set_size (qtdemux->old_streams, 0); qtdemux->n_video_streams = 0; qtdemux->n_audio_streams = 0; qtdemux->n_sub_streams = 0; @@ -2284,7 +2282,7 @@ gst_qtdemux_stream_concat (GstQTDemux * qtdemux, GPtrArray * dest, g_ptr_array_add (dest, gst_qtdemux_stream_ref (stream)); } - g_ptr_array_remove_range (src, 0, len); + g_ptr_array_set_size (src, 0); } static gboolean @@ -12909,9 +12907,7 @@ qtdemux_expose_streams (GstQTDemux * qtdemux) return GST_FLOW_ERROR; } - g_ptr_array_remove_range (qtdemux->old_streams, - 0, qtdemux->old_streams->len); - + g_ptr_array_set_size (qtdemux->old_streams, 0); qtdemux->need_segment = TRUE; return GST_FLOW_OK; @@ -12953,7 +12949,7 @@ qtdemux_expose_streams (GstQTDemux * qtdemux) } } - g_ptr_array_remove_range (qtdemux->old_streams, 0, qtdemux->old_streams->len); + g_ptr_array_set_size (qtdemux->old_streams, 0); /* check if we should post a redirect in case there is a single trak * and it is a redirecting trak */