Skip to content
Snippets Groups Projects
Commit 8f42f523 authored by Ronald S. Bultje's avatar Ronald S. Bultje Committed by Baptiste Coudurier
Browse files

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

Originally committed as revision 7736 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent b3203b64
No related branches found
No related tags found
No related merge requests found
...@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment