# HG changeset patch # User bcoudurier # Date 1169951882 0 # Node ID e9c7714b1c34a31c85409fc33d7e4e82b505063e # Parent 5ebac013d792d207bac3d160c0d81c83c37be1f0 proper error handling in file size retrieval, patch by Ronald S. Bultje rbultje at ronald bitfreak net diff -r 5ebac013d792 -r e9c7714b1c34 aviobuf.c --- 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;