rndbuffersize event handling procedure: leak, probably misbehavior

Sebastian Dröge sebastian at centricular.com
Tue Dec 24 05:42:04 PST 2013


On Mo, 2013-12-23 at 21:50 +0200, Andrey Utkin wrote:
> Seems gst_rnd_buffer_size_src_event() from
> gst-plugins-good/gst/debugutils/rndbuffersize.c has problems, and i am
> not sure which exactly and how many.
> For now i have checked that at least it leaks memory of event object.
> 
> It can be reproduced with
> 
> G_SLICE=always-malloc valgrind --show-reachable=no
> --suppressions=/usr/local/src/gstreamer/common/gst.supp gst-launch-1.0
> fakesrc ! rndbuffersize ! fakesink
> 
> You'll see here a single leak of resource allocated at gst_event_new_latency().
> I think it lacks at least gst_event_unref() call here:
> 
> if (GST_EVENT_TYPE (event) != GST_EVENT_SEEK) {
>     GST_WARNING_OBJECT (pad, "dropping %s event", GST_EVENT_TYPE_NAME (event));
>     return FALSE;
> }
> 
> But i am not sure is it enough, maybe it would be even more correct to
> forward that event. At last in rtspsrc i see that GST_EVENT_LATENCY is
> forwarded.
> 
> I ask for clarification so i could prepare a patch, or for a fix by developers.

This is correct, it should at least call unref() there when dropping the
event. However dropping events there does not make sense, instead the
default handler should be called.

Also some other pad event handling did not make much sense either. This
should be fixed with this:
http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=2f07b570f76b4a2e5de40b1fe467aad29ece3ed0

-- 
Sebastian Dröge, Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 966 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20131224/a0324c78/attachment.pgp>


More information about the gstreamer-devel mailing list