asset: Avoid dereferencing NULL pointer
authorThibault Saunier <tsaunier@igalia.com>
Thu, 9 Apr 2020 15:24:44 +0000 (11:24 -0400)
committerThibault Saunier <tsaunier@igalia.com>
Fri, 10 Apr 2020 15:12:12 +0000 (11:12 -0400)
CID 1461286

ges/ges-project.c
ges/ges-timeline.c

index 75b7a49..634a38d 100644 (file)
@@ -606,7 +606,7 @@ ges_project_class_init (GESProjectClass * klass)
    * @project: the #GESProject on which a problem happend when creted a #GESAsset
    * @timeline: The timeline that failed loading
    * @error: The #GError defining the error that occured
-   * 
+   *
    * Since: 1.18
    */
   _signals[ERROR_LOADING] =
@@ -738,10 +738,11 @@ new_asset_cb (GESAsset * source, GAsyncResult * res, GESProject * project)
     return;
   }
 
-  ges_asset_finish_proxy (asset);
-  ges_project_add_asset (project, asset);
-  if (asset)
+  if (asset) {
+    ges_asset_finish_proxy (asset);
+    ges_project_add_asset (project, asset);
     gst_object_unref (asset);
+  }
 }
 
 /**
index c6d59fd..d8dd8e5 100644 (file)
@@ -1244,7 +1244,6 @@ _trim_transition (GESTimeline * timeline, GESTimelineElement * element,
   return FALSE;
 }
 
-
 gboolean
 timeline_trim_object (GESTimeline * timeline, GESTimelineElement * object,
     guint32 new_layer_priority, GList * layers, GESEdge edge, guint64 position)