diff options
author | Wim Taymans <wtaymans@redhat.com> | 2015-05-11 10:52:23 +0200 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2015-05-18 11:26:07 +0200 |
commit | 1d1f76a328e94a6edd12994944b57af736b39144 (patch) | |
tree | 32fd3413c13651253edef66a9013a228a049b0d8 /plugins | |
parent | 460a7bf68292d057c77e84d1ea86b8e73fc081f3 (diff) |
sparsefile: small cleanup
The error path unrefs file->file so make sure we only go there when
there is a non-NULL file->file.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/elements/gstsparsefile.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/plugins/elements/gstsparsefile.c b/plugins/elements/gstsparsefile.c index fb9b26cfe..b8a0577d8 100644 --- a/plugins/elements/gstsparsefile.c +++ b/plugins/elements/gstsparsefile.c @@ -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; |