From 99c78b5e33c7ee8dd69d53113752cc1cf7f12a25 Mon Sep 17 00:00:00 2001 From: Eunhae Choi Date: Mon, 1 Oct 2018 16:32:01 +0900 Subject: [PATCH] pdpushsrc: fix svace issue Change-Id: I13c966cc1dcfaa01fd8e8dce06bf6d8fbacc5f00 --- pdpushsrc/src/gstpdpushsrc.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pdpushsrc/src/gstpdpushsrc.c b/pdpushsrc/src/gstpdpushsrc.c index 266ca18..54f4bf2 100644 --- a/pdpushsrc/src/gstpdpushsrc.c +++ b/pdpushsrc/src/gstpdpushsrc.c @@ -629,7 +629,9 @@ gst_pd_pushsrc_start (GstBaseSrc * basesrc) } else { src->seekable = TRUE; } - lseek (src->fd, 0, SEEK_SET); + + if (lseek (src->fd, 0, SEEK_SET) < 0) + goto seek_failed; } /* We can only really do seeking on regular files - for other file types, we @@ -681,12 +683,19 @@ was_directory: } was_socket: { - GST_ERROR_OBJECT (src, "Is a Socket"); + GST_ERROR_OBJECT (src, "Is a Socket"); GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, ("File \"\" is a socket."), (NULL)); close (src->fd); return FALSE; } +seek_failed: + { + GST_ERROR_OBJECT (src, "Seek failed..."); + GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, (NULL), GST_ERROR_SYSTEM); + close (src->fd); + return FALSE; + } } /* unmap and close the file */ -- 2.7.4