basetransform: don't unref trans until the function is done using it
authorHavard Graff <havard.graff@tandberg.com>
Thu, 14 Apr 2011 08:15:26 +0000 (10:15 +0200)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Tue, 19 Apr 2011 14:09:14 +0000 (15:09 +0100)
trans->priv->force_alloc = FALSE would crash if the ref held is the last

https://bugzilla.gnome.org/show_bug.cgi?id=648215

libs/gst/base/gstbasetransform.c

index 4a0e24f..71cc9b9 100644 (file)
@@ -1963,7 +1963,6 @@ gst_base_transform_buffer_alloc (GstPad * pad, guint64 offset, guint size,
     sink_suggest = NULL;
   }
 
-  gst_object_unref (trans);
   if (sink_suggest)
     gst_caps_unref (sink_suggest);
 
@@ -1974,6 +1973,7 @@ gst_base_transform_buffer_alloc (GstPad * pad, guint64 offset, guint size,
     trans->priv->force_alloc = FALSE;
   }
 
+  gst_object_unref (trans);
   return res;
 
   /* ERRORS */