udpsrc: sanity check size of available packet data for reading to avoid memory waste
authorTim-Philipp Müller <tim@centricular.net>
Wed, 2 Jan 2013 00:03:27 +0000 (00:03 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Fri, 4 Jan 2013 14:00:55 +0000 (14:00 +0000)
commitcf1f6aff0de8ee7d735e964b17bbe253148bb671
tree5d26137759419c703f3ddaa8b1bbe6f11d042872
parentad2f74afbc145e293b99bcffe5f32050b3b795b3
udpsrc: sanity check size of available packet data for reading to avoid memory waste

On Windows and OS/X, _get_available_bytes() may not return the size
of the next pending packet, but the size of all pending packets in
the kernel-side buffer, which might be rather large depending on
configuration. Sanity-check the size returned by _get_available_bytes()
to make sure we never allocate more memory than the max. size for
a packet, if it's an IPv4 socket.

https://bugzilla.gnome.org/show_bug.cgi?id=610364
gst/udp/gstudpsrc.c