sparsefile: small cleanup

The error path unrefs file->file so make sure we only go there when
there is a non-NULL file->file.
This commit is contained in:
Wim Taymans 2015-05-11 10:52:23 +02:00
parent 460a7bf682
commit 1d1f76a328

View file

@ -343,13 +343,12 @@ gst_sparse_file_read (GstSparseFile * file, gsize offset, gpointer data,
goto error;
}
res = fread (data, 1, count, file->file);
if (G_UNLIKELY (res < count))
goto error;
}
file->current_pos = offset + res;
if (G_UNLIKELY (res < count))
goto error;
if (remaining)
*remaining = range->stop - file->current_pos;