Mercurial > libavformat.hg
changeset 1741:e9c7714b1c34 libavformat
proper error handling in file size retrieval, patch by Ronald S. Bultje rbultje at ronald bitfreak net
author | bcoudurier |
---|---|
date | Sun, 28 Jan 2007 02:38:02 +0000 |
parents | 5ebac013d792 |
children | da3d430bfe71 |
files | aviobuf.c |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/aviobuf.c Sat Jan 27 12:07:16 2007 +0000 +++ b/aviobuf.c Sun Jan 28 02:38:02 2007 +0000 @@ -172,7 +172,9 @@ 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;