1efc7f
From 5f41f4683d50fce293d770ae35f3f9a0083744a6 Mon Sep 17 00:00:00 2001
1efc7f
From: Debarshi Ray <rishi@gnu.org>
1efc7f
Date: Tue, 6 Nov 2012 19:49:45 +0100
1efc7f
Subject: [PATCH] v4l2src: Check for obj->pool == NULL
1efc7f
1efc7f
Not sure how it could happen and can not reproduce it either, but it
1efc7f
did happen once during a VoIP call and the backtrace lays the blame
1efc7f
on obj->pool being NULL.
1efc7f
1efc7f
https://bugzilla.gnome.org/show_bug.cgi?id=687793
1efc7f
---
1efc7f
 sys/v4l2/gstv4l2src.c | 5 ++++-
1efc7f
 1 file changed, 4 insertions(+), 1 deletion(-)
1efc7f
1efc7f
diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c
1efc7f
index 6197f78..58ff481 100644
1efc7f
--- a/sys/v4l2/gstv4l2src.c
1efc7f
+++ b/sys/v4l2/gstv4l2src.c
1efc7f
@@ -763,11 +763,14 @@ gst_v4l2src_fill (GstPushSrc * src, GstBuffer * buf)
1efc7f
 {
1efc7f
   GstV4l2Src *v4l2src = GST_V4L2SRC (src);
1efc7f
   GstV4l2Object *obj = v4l2src->v4l2object;
1efc7f
-  GstFlowReturn ret;
1efc7f
+  GstFlowReturn ret = GST_FLOW_ERROR;
1efc7f
   GstClock *clock;
1efc7f
   GstClockTime abs_time, base_time, timestamp, duration;
1efc7f
   GstClockTime delay;
1efc7f
 
1efc7f
+  if (G_UNLIKELY (obj->pool == NULL))
1efc7f
+    goto error;
1efc7f
+
1efc7f
   ret =
1efc7f
       gst_v4l2_buffer_pool_process (GST_V4L2_BUFFER_POOL_CAST (obj->pool), buf);
1efc7f
 
1efc7f
-- 
1efc7f
1.7.12.1
1efc7f