summaryrefslogtreecommitdiff
path: root/libavformat/aviobuf.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2007-01-28 02:38:02 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2007-01-28 02:38:02 +0000
commit8f42f5238e7effbf6e41977c5018d0e50770365c (patch)
tree914e5bf1208026f8bf5e881c5ce3c805dc011f6f /libavformat/aviobuf.c
parentb3203b64c6374332359ac3410633f04c1aaa3534 (diff)
proper error handling in file size retrieval, patch by Ronald S. Bultje rbultje at ronald bitfreak net
Originally committed as revision 7736 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/aviobuf.c')
-rw-r--r--libavformat/aviobuf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 4a595e2e43..ab8fc1da39 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -172,7 +172,9 @@ offset_t url_fsize(ByteIOContext *s)
return -EPIPE;
size = s->seek(s->opaque, 0, AVSEEK_SIZE);
if(size<0){
- size = s->seek(s->opaque, -1, SEEK_END) + 1;
+ if ((size = s->seek(s->opaque, -1, SEEK_END)) < 0)
+ return size;
+ size++;
s->seek(s->opaque, s->pos, SEEK_SET);
}
return size;