summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2014-12-30 16:26:58 +0100
committerSebastian Dröge <sebastian@centricular.com>2014-12-30 16:28:09 +0100
commitbbcfc3b9e632f490880a68397078bf1b998d499d (patch)
tree0a9a0e75ab7578ed91c6bceab9b925899a693fb7 /ext
parentd416336a6e9c92a61c59276f6aed8f1e821a142d (diff)
downloadgstreamer-plugins-good-bbcfc3b9e632f490880a68397078bf1b998d499d.tar.gz
souphttpsrc: Don't return a buffer when returning not GST_FLOW_OK
basesrc assumes that we don't return a buffer if something else than OK is returned. It will just leak any buffer we might accidentially provide here. This can potentially happen during flushing. Maybe fixes https://bugzilla.gnome.org/show_bug.cgi?id=741993
Diffstat (limited to 'ext')
-rw-r--r--ext/soup/gstsouphttpsrc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/soup/gstsouphttpsrc.c b/ext/soup/gstsouphttpsrc.c
index 5f940ab2b..6b0731000 100644
--- a/ext/soup/gstsouphttpsrc.c
+++ b/ext/soup/gstsouphttpsrc.c
@@ -1709,6 +1709,18 @@ gst_soup_http_src_do_request (GstSoupHTTPSrc * src, const gchar * method,
src->ret = GST_FLOW_EOS;
g_cond_signal (&src->request_finished_cond);
+ /* basesrc assumes that we don't return a buffer if
+ * something else than OK is returned. It will just
+ * leak any buffer we might accidentially provide
+ * here.
+ *
+ * This can potentially happen during flushing.
+ */
+ if (src->ret != GST_FLOW_OK && outbuf && *outbuf) {
+ gst_buffer_unref (*outbuf);
+ *outbuf = NULL;
+ }
+
return src->ret;
}