From: Jaroslav Kysela Date: Tue, 8 Mar 2016 10:44:34 +0000 (+0100) Subject: filebundle: fix fb_read - fread might return an error or 0 X-Git-Tag: v4.2.1~943 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ab3ce18720e2cedf8c1384a2a892efebc282ff5b;p=thirdparty%2Ftvheadend.git filebundle: fix fb_read - fread might return an error or 0 --- diff --git a/src/filebundle.c b/src/filebundle.c index 628c4d3cf..274bd7f77 100644 --- a/src/filebundle.c +++ b/src/filebundle.c @@ -435,6 +435,8 @@ ssize_t fb_read ( fb_file *fp, void *buf, size_t count ) fp->pos += count; } else if (fp->type == FB_DIRECT) { count = fread(buf, 1, count, fp->d.cur); + if (count <= 0) + return -1; fp->pos += count; } else { count = MIN(count, fp->b.root->f.size - fp->pos);