From: Wim Taymans Date: Mon, 11 May 2015 08:52:23 +0000 (+0200) Subject: sparsefile: small cleanup X-Git-Tag: 1.6.1~324 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1d1f76a328e94a6edd12994944b57af736b39144;p=platform%2Fupstream%2Fgstreamer.git sparsefile: small cleanup The error path unrefs file->file so make sure we only go there when there is a non-NULL file->file. --- diff --git a/plugins/elements/gstsparsefile.c b/plugins/elements/gstsparsefile.c index fb9b26c..b8a0577 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;