mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-21 09:53:47 +00:00
udpsrc: on receive error only unmap and unref buffer if one was alloced and mapped
coverity CID 1139866.
This commit is contained in:
parent
627109ce4d
commit
9c9efffd8c
1 changed files with 5 additions and 3 deletions
|
@ -390,7 +390,7 @@ gst_udpsrc_create (GstPushSrc * psrc, GstBuffer ** buf)
|
||||||
{
|
{
|
||||||
GstFlowReturn ret;
|
GstFlowReturn ret;
|
||||||
GstUDPSrc *udpsrc;
|
GstUDPSrc *udpsrc;
|
||||||
GstBuffer *outbuf;
|
GstBuffer *outbuf = NULL;
|
||||||
GstMapInfo info;
|
GstMapInfo info;
|
||||||
GSocketAddress *saddr = NULL;
|
GSocketAddress *saddr = NULL;
|
||||||
gsize offset;
|
gsize offset;
|
||||||
|
@ -555,8 +555,10 @@ alloc_failed:
|
||||||
}
|
}
|
||||||
receive_error:
|
receive_error:
|
||||||
{
|
{
|
||||||
gst_buffer_unmap (outbuf, &info);
|
if (outbuf != NULL) {
|
||||||
gst_buffer_unref (outbuf);
|
gst_buffer_unmap (outbuf, &info);
|
||||||
|
gst_buffer_unref (outbuf);
|
||||||
|
}
|
||||||
|
|
||||||
if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_BUSY) ||
|
if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_BUSY) ||
|
||||||
g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
|
g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
|
||||||
|
|
Loading…
Reference in a new issue