ges: Do not use freed pointers

COVERTY CID 1212182
COVERTY CID 1212184
COVERTY CID 1212185
This commit is contained in:
Thibault Saunier 2014-05-10 22:52:18 +02:00
parent 3c1518be6c
commit b2c8a9efb3
2 changed files with 12 additions and 10 deletions

View file

@ -555,9 +555,9 @@ _free_pending_asset (GESBaseXmlFormatterPrivate * priv, PendingAsset * passet)
g_free (passet->metadatas);
if (passet->properties)
gst_structure_free (passet->properties);
g_slice_free (PendingAsset, passet);
priv->pending_assets = g_list_remove (priv->pending_assets, passet);
g_slice_free (PendingAsset, passet);
}
static void

View file

@ -445,9 +445,6 @@ create_pipeline (GESTimeline ** ret_timeline, gchar * load_path,
ges_timeline_commit (timeline);
if (uri)
g_free (uri);
/* save project if path is given. we do this now in case GES crashes or
* hangs during playback. */
if (save_path && !load_path) {
@ -457,7 +454,6 @@ create_pipeline (GESTimeline ** ret_timeline, gchar * load_path,
goto failure;
}
ges_timeline_save_to_uri (timeline, uri, NULL, TRUE, NULL);
g_free (uri);
}
/* In order to view our timeline, let's grab a convenience pipeline to put
@ -479,17 +475,23 @@ create_pipeline (GESTimeline ** ret_timeline, gchar * load_path,
goto failure;
*ret_timeline = timeline;
done:
if (uri)
g_free (uri);
return pipeline;
failure:
{
if (uri)
g_free (uri);
if (timeline)
gst_object_unref (timeline);
if (pipeline)
gst_object_unref (pipeline);
return NULL;
pipeline = NULL;
timeline = NULL;
goto done;
}
}
@ -587,7 +589,6 @@ static GstEncodingProfile *
_parse_encoding_profile (const gchar * format)
{
GstCaps *caps;
char *preset_name = NULL;
GstEncodingProfile *encoding_profile;
gchar **restriction_format, **preset_v;
@ -610,8 +611,9 @@ _parse_encoding_profile (const gchar * format)
}
for (i = 1; strcaps_v[i]; i++) {
GstEncodingProfile *profile = NULL;
gchar *strcaps, *strpresence;
char *preset_name = NULL;
GstEncodingProfile *profile = NULL;
restriction_format = g_strsplit (strcaps_v[i], "->", 0);
if (restriction_format[1]) {