Commit f90ded0b authored by bcoudurier's avatar bcoudurier

proper error handling in file size retrieval, patch by Ronald S. Bultje...

proper error handling in file size retrieval, patch by Ronald S. Bultje rbultje at ronald bitfreak net

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@7736 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent de153855
...@@ -172,7 +172,9 @@ offset_t url_fsize(ByteIOContext *s) ...@@ -172,7 +172,9 @@ offset_t url_fsize(ByteIOContext *s)
return -EPIPE; return -EPIPE;
size = s->seek(s->opaque, 0, AVSEEK_SIZE); size = s->seek(s->opaque, 0, AVSEEK_SIZE);
if(size<0){ 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); s->seek(s->opaque, s->pos, SEEK_SET);
} }
return size; return size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment