From: Michael Olbrich Date: Fri, 5 Jul 2013 09:51:04 +0000 (+0200) Subject: v4l2: bufferpool: don't forget to release buffer on error X-Git-Tag: 1.19.3~509^2~5643 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=07e4dd3424459c05a6711df93a3a169b7822ce48;p=platform%2Fupstream%2Fgstreamer.git v4l2: bufferpool: don't forget to release buffer on error If the pool is stopped while gst_v4l2_buffer_pool_dqbuf() waits for a buffer then the return value is GST_FLOW_FLUSHING. In this case the buffer to queue must also be released. Otherwise is will never be deleted or returned to its pool. https://bugzilla.gnome.org/show_bug.cgi?id=703764 --- diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c index 3ead390..1e74fc7 100644 --- a/sys/v4l2/gstv4l2bufferpool.c +++ b/sys/v4l2/gstv4l2bufferpool.c @@ -1262,8 +1262,10 @@ gst_v4l2_buffer_pool_process (GstV4l2BufferPool * pool, GstBuffer * buf) /* all buffers are queued, try to dequeue one and release it back * into the pool so that _acquire can get to it again. */ ret = gst_v4l2_buffer_pool_dqbuf (pool, &out); - if (ret != GST_FLOW_OK) + if (ret != GST_FLOW_OK) { + gst_buffer_unref (to_queue); goto done; + } /* release the rendered buffer back into the pool. This wakes up any * thread waiting for a buffer in _acquire(). If the buffer still has