matroskademux: avoid sorting NULL array of cluster positions

This commit is contained in:
Mark Nauwelaerts 2011-02-14 17:49:54 +01:00
parent 4279aa6a68
commit d466f07def

View file

@ -5482,7 +5482,8 @@ gst_matroska_demux_parse_contents (GstMatroskaDemux * demux, GstEbmlRead * ebml)
DEBUG_ELEMENT_STOP (demux, ebml, "SeekHead", ret);
/* Sort clusters by position for easier searching */
g_array_sort (demux->clusters, (GCompareFunc) gst_matroska_cluster_compare);
if (demux->clusters)
g_array_sort (demux->clusters, (GCompareFunc) gst_matroska_cluster_compare);
return ret;
}