Blob Blame History Raw
From 5f41f4683d50fce293d770ae35f3f9a0083744a6 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <rishi@gnu.org>
Date: Tue, 6 Nov 2012 19:49:45 +0100
Subject: [PATCH] v4l2src: Check for obj->pool == NULL

Not sure how it could happen and can not reproduce it either, but it
did happen once during a VoIP call and the backtrace lays the blame
on obj->pool being NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=687793
---
 sys/v4l2/gstv4l2src.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c
index 6197f78..58ff481 100644
--- a/sys/v4l2/gstv4l2src.c
+++ b/sys/v4l2/gstv4l2src.c
@@ -763,11 +763,14 @@ gst_v4l2src_fill (GstPushSrc * src, GstBuffer * buf)
 {
   GstV4l2Src *v4l2src = GST_V4L2SRC (src);
   GstV4l2Object *obj = v4l2src->v4l2object;
-  GstFlowReturn ret;
+  GstFlowReturn ret = GST_FLOW_ERROR;
   GstClock *clock;
   GstClockTime abs_time, base_time, timestamp, duration;
   GstClockTime delay;
 
+  if (G_UNLIKELY (obj->pool == NULL))
+    goto error;
+
   ret =
       gst_v4l2_buffer_pool_process (GST_V4L2_BUFFER_POOL_CAST (obj->pool), buf);
 
-- 
1.7.12.1