sparsefile: fix possible crash when seeking

In gst_sparse_file_clear function we were closing a file and
reopening it using closed file descriptor.

Fix: Removed closing and reopening of file.

Fixes #512

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/372>
This commit is contained in:
dhilshad 2020-02-15 22:20:18 +05:30 committed by Tim-Philipp Müller
parent c666a9a7e1
commit 5f7e3392a9

View file

@ -191,10 +191,6 @@ gst_sparse_file_clear (GstSparseFile * file)
{
g_return_if_fail (file != NULL);
if (file->file) {
fclose (file->file);
file->file = fdopen (file->fd, "wb+");
}
g_slice_free_chain (GstSparseRange, file->ranges, next);
file->current_pos = 0;
file->ranges = NULL;