goom: Return not-negotiated when bps is unknown
authorThiago Santos <thiago.sousa.santos@collabora.co.uk>
Tue, 26 Oct 2010 18:44:37 +0000 (15:44 -0300)
committerThiago Santos <thiago.sousa.santos@collabora.co.uk>
Thu, 28 Oct 2010 13:34:29 +0000 (10:34 -0300)
If caps weren't negotiated, goom should return not-negotiated
from its chain functions instead of using bps unitialized, which
leads to a division by 0

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

gst/goom/gstgoom.c

index 2ae669c..30a6c8c 100644 (file)
@@ -485,6 +485,10 @@ gst_goom_chain (GstPad * pad, GstBuffer * buffer)
   GstBuffer *outbuf = NULL;
 
   goom = GST_GOOM (gst_pad_get_parent (pad));
+  if (goom->bps == 0) {
+    ret = GST_FLOW_NOT_NEGOTIATED;
+    goto beach;
+  }
 
   /* If we don't have an output format yet, preallocate a buffer to try and
    * set one */