pad: fail dropped queries
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Mon, 3 Nov 2014 17:46:57 +0000 (17:46 +0000)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Wed, 12 Nov 2014 11:04:21 +0000 (11:04 +0000)
Previously, dropping a query from a pad probe would deem the
query succeeded, and the caller might then assume the query's
results are valid, and thus dereference an invalid object
such as a GstCaps.

We now assume dropped queries did not succeed. Dropped events
and buffers are still deemed a success.

gst/gstpad.c

index e835e29..4c063fe 100644 (file)
@@ -3643,11 +3643,8 @@ probe_stopped:
       GST_PAD_STREAM_UNLOCK (pad);
 
     /* if a probe dropped, we don't sent it further but assume that the probe
-     * answered the query and return TRUE */
-    if (ret == GST_FLOW_CUSTOM_SUCCESS)
-      res = TRUE;
-    else
-      res = FALSE;
+     * did not answer the query and return FALSE */
+    res = FALSE;
 
     return res;
   }
@@ -3760,11 +3757,8 @@ probe_stopped:
     GST_OBJECT_UNLOCK (pad);
 
     /* if a probe dropped, we don't sent it further but assume that the probe
-     * answered the query and return TRUE */
-    if (ret == GST_FLOW_CUSTOM_SUCCESS)
-      res = TRUE;
-    else
-      res = FALSE;
+     * did not answer the query and return FALSE */
+    res = FALSE;
 
     return res;
   }