OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2568646
)
file: return proper error on seek failures
author
Luca Barbato
<lu_zero@gentoo.org>
Fri, 14 Sep 2012 15:01:35 +0000
(17:01 +0200)
committer
Luca Barbato
<lu_zero@gentoo.org>
Sun, 16 Sep 2012 13:37:14 +0000
(15:37 +0200)
libavformat/file.c
patch
|
blob
|
history
diff --git
a/libavformat/file.c
b/libavformat/file.c
index
3ea681f
..
fc0af92
100644
(file)
--- a/
libavformat/file.c
+++ b/
libavformat/file.c
@@
-121,12
+121,18
@@
static int file_open(URLContext *h, const char *filename, int flags)
static int64_t file_seek(URLContext *h, int64_t pos, int whence)
{
FileContext *c = h->priv_data;
+ int ret;
+
if (whence == AVSEEK_SIZE) {
struct stat st;
- int ret = fstat(c->fd, &st);
+
+ ret = fstat(c->fd, &st);
return ret < 0 ? AVERROR(errno) : st.st_size;
}
- return lseek(c->fd, pos, whence);
+
+ ret = lseek(c->fd, pos, whence);
+
+ return ret < 0 ? AVERROR(errno) : ret;
}
static int file_close(URLContext *h)