From: Ronald S. Bultje Date: Sun, 28 Jan 2007 02:38:02 +0000 (+0000) Subject: proper error handling in file size retrieval, patch by Ronald S. Bultje rbultje at... X-Git-Tag: v0.5~10324 X-Git-Url: https://git.videolan.org/?p=ffmpeg.git;a=commitdiff_plain;h=8f42f5238e7effbf6e41977c5018d0e50770365c 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 --- 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;