]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
filebundle: fix fb_read - fread might return an error or 0
authorJaroslav Kysela <perex@perex.cz>
Tue, 8 Mar 2016 10:44:34 +0000 (11:44 +0100)
committerJaroslav Kysela <perex@perex.cz>
Tue, 8 Mar 2016 10:44:44 +0000 (11:44 +0100)
src/filebundle.c

index ff4c284563cf69fe37021d274929882d9cf00bb6..6d238fa5f053e7344db303d30519ce1b2efd7991 100644 (file)
@@ -521,6 +521,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);