]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
filebundle: fb_read must return real len in FB_DIRECT mode
authorJoakim Plate <elupus@ecce.se>
Sat, 29 Dec 2012 19:34:11 +0000 (20:34 +0100)
committerJoakim Plate <elupus@ecce.se>
Sat, 29 Dec 2012 19:34:11 +0000 (20:34 +0100)
src/filebundle.c

index 81993d037ae4f0ed9de94d06af5bf6de4717a753..295ed00fa1a27f676fbff8df1bc6912338f5fd50 100644 (file)
@@ -493,7 +493,8 @@ ssize_t fb_read ( fb_file *fp, void *buf, size_t count )
     memcpy(buf, fp->buf + fp->pos, count);
     fp->pos += count;
   } else if (fp->type == FB_DIRECT) {
-    fp->pos += fread(buf, 1, count, fp->d.cur);
+    count = fread(buf, 1, count, fp->d.cur);
+    fp->pos += count;
   } else {
     count = MIN(count, fp->b.root->f.size - fp->pos);
     memcpy(buf, fp->b.root->f.data + fp->pos, count);