]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
flac afh: Fix off-by-one bug in meta_eof_cb().
authorAndre Noll <maan@systemlinux.org>
Tue, 24 Dec 2013 17:49:41 +0000 (17:49 +0000)
committerAndre Noll <maan@systemlinux.org>
Fri, 18 Apr 2014 19:36:53 +0000 (19:36 +0000)
After the full file has been read, the file position equals the number
of available bytes. The eof callback did not report EOF in this case.

flac_afh.c

index 21f86f4645bfd483e4a23f3e5c577a8626e7b630..eeb0e86c32ac558cc483fe1fc4ce1270c8f0d2f8 100644 (file)
@@ -80,7 +80,7 @@ static FLAC__int64 meta_tell_cb(FLAC__IOHandle handle)
 static int meta_eof_cb(FLAC__IOHandle handle)
 {
        struct private_flac_afh_data *pfad = handle;
 static int meta_eof_cb(FLAC__IOHandle handle)
 {
        struct private_flac_afh_data *pfad = handle;
-       return pfad->fpos == pfad->map_bytes - 1;
+       return pfad->fpos == pfad->map_bytes;
 }
 
 static int meta_close_cb(FLAC__IOHandle __a_unused handle)
 }
 
 static int meta_close_cb(FLAC__IOHandle __a_unused handle)