forked from FFmpeg/FFmpeg
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
This commit is contained in:
parent
b3203b64c6
commit
8f42f5238e
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue