null reference in gstwavparse.c

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

null reference in gstwavparse.c

Conrad Cooke
I was encountering a crash due to referencing a null pointer on calling gst_wavparse_pad_query ()

The pad passed in is valid but its parent is null.

In this case, the pipeline is changing state.

I 'fixed' it by simply checking the reference and returning false if null.
Is this a valid fix or am I masking some other issue?

Here is my diff:

 Index: gst/wavparse/gstwavparse.c
===================================================================
--- gst/wavparse/gstwavparse.c (.../44) (revision 227892)
+++ gst/wavparse/gstwavparse.c (.../45) (revision 227892)
@@ -2089,6 +2089,10 @@
 {
   gboolean res = TRUE;
   GstWavParse *wav = GST_WAVPARSE (gst_pad_get_parent (pad));
+  if (NULL == wav)  {
+      GST_ERROR_OBJECT (wav, "GstWavParse null reference");
+ return FALSE;
+  }

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel