projects
/
platform
/
upstream
/
gstreamer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
460a7bf
)
sparsefile: small cleanup
author
Wim Taymans
<wtaymans@redhat.com>
Mon, 11 May 2015 08:52:23 +0000
(10:52 +0200)
committer
Wim Taymans
<wtaymans@redhat.com>
Mon, 18 May 2015 09:26:07 +0000
(11:26 +0200)
The error path unrefs file->file so make sure we only go there when
there is a non-NULL file->file.
plugins/elements/gstsparsefile.c
patch
|
blob
|
history
diff --git
a/plugins/elements/gstsparsefile.c
b/plugins/elements/gstsparsefile.c
index
fb9b26c
..
b8a0577
100644
(file)
--- 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;