[gst-cvs] gst-plugins-good: v4l2sink: Protect against NULL-pointer access

Sebastian Dröge slomo at kemper.freedesktop.org
Sun Oct 10 02:23:49 PDT 2010


Module: gst-plugins-good
Branch: master
Commit: 4ba93e9f1a460452a9baaff4038d6d99cf387627
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=4ba93e9f1a460452a9baaff4038d6d99cf387627

Author: IOhannes m zmölnig <zmoelnig at iem.at>
Date:   Thu Sep 30 15:28:23 2010 +0200

v4l2sink: Protect against NULL-pointer access

gst_v4l2sink_change_state() would free the pool without checking whether there
was a valid pool...

---

 sys/v4l2/gstv4l2sink.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/sys/v4l2/gstv4l2sink.c b/sys/v4l2/gstv4l2sink.c
index 679f7e2..7dc1382 100644
--- a/sys/v4l2/gstv4l2sink.c
+++ b/sys/v4l2/gstv4l2sink.c
@@ -461,7 +461,8 @@ gst_v4l2sink_change_state (GstElement * element, GstStateChange transition)
       }
       break;
     case GST_STATE_CHANGE_READY_TO_NULL:
-      gst_v4l2_buffer_pool_destroy (v4l2sink->pool);
+      if (NULL != v4l2sink->pool)
+        gst_v4l2_buffer_pool_destroy (v4l2sink->pool);
       v4l2sink->pool = NULL;
       /* close the device */
       if (!gst_v4l2_object_stop (v4l2sink->v4l2object))





More information about the Gstreamer-commits mailing list