Browse code

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

Ronald S. Bultje authored on 2007/01/28 11:38:02
Showing 1 changed files
... ...
@@ -172,7 +172,9 @@ offset_t url_fsize(ByteIOContext *s)
172 172
         return -EPIPE;
173 173
     size = s->seek(s->opaque, 0, AVSEEK_SIZE);
174 174
     if(size<0){
175
-        size = s->seek(s->opaque, -1, SEEK_END) + 1;
175
+        if ((size = s->seek(s->opaque, -1, SEEK_END)) < 0)
176
+            return size;
177
+        size++;
176 178
         s->seek(s->opaque, s->pos, SEEK_SET);
177 179
     }
178 180
     return size;