From 63746c4131352a880c1a127d464b013b57d597fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Wed, 25 Feb 2015 16:45:11 -0800 Subject: [PATCH] v4l2bufferpool: Check corruption flag on the right buffer We where checking the buffer we are copying to instead of the buffer we are copying from. https://bugzilla.gnome.org/show_bug.cgi?id=740040 --- sys/v4l2/gstv4l2bufferpool.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c index 543ce917b4..1cb902d424 100644 --- a/sys/v4l2/gstv4l2bufferpool.c +++ b/sys/v4l2/gstv4l2bufferpool.c @@ -1715,9 +1715,12 @@ gst_v4l2_buffer_pool_process (GstV4l2BufferPool * pool, GstBuffer ** buf) /* An empty buffer on capture indicates the end of stream */ if (gst_buffer_get_size (tmp) == 0) { + gboolean corrupted = GST_BUFFER_FLAG_IS_SET (tmp, + GST_BUFFER_FLAG_CORRUPTED); + gst_v4l2_buffer_pool_release_buffer (bpool, tmp); - if (GST_BUFFER_FLAG_IS_SET (*buf, GST_BUFFER_FLAG_CORRUPTED)) + if (corrupted) goto buffer_corrupted; else goto eos;