mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-22 14:06:23 +00:00
v4l2: minor fix for closing the fd
The fd returned by open() could theoretically be 0 as well. Coverity CID 1211823.
This commit is contained in:
parent
985897d8d9
commit
17c107d4e4
1 changed files with 2 additions and 2 deletions
|
@ -102,7 +102,7 @@ gst_v4l2_probe_and_register (GstPlugin * plugin)
|
|||
GstCaps *src_caps, *sink_caps;
|
||||
gchar *basename;
|
||||
|
||||
if (video_fd > 0)
|
||||
if (video_fd >= 0)
|
||||
close (video_fd);
|
||||
|
||||
video_fd = open (it->device_path, O_RDWR);
|
||||
|
@ -158,7 +158,7 @@ gst_v4l2_probe_and_register (GstPlugin * plugin)
|
|||
break;
|
||||
}
|
||||
|
||||
if (video_fd > 0)
|
||||
if (video_fd >= 0)
|
||||
close (video_fd);
|
||||
|
||||
gst_v4l2_iterator_free (it);
|
||||
|
|
Loading…
Reference in a new issue