From: Andre Noll Date: Tue, 24 Dec 2013 17:49:41 +0000 (+0000) Subject: flac afh: Fix off-by-one bug in meta_eof_cb(). X-Git-Tag: v0.5.3~27 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=0167db5efedd2948d12e6daa48bd9907e072cb97;p=paraslash.git flac afh: Fix off-by-one bug in meta_eof_cb(). 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. --- diff --git a/flac_afh.c b/flac_afh.c index 21f86f46..eeb0e86c 100644 --- a/flac_afh.c +++ b/flac_afh.c @@ -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; - return pfad->fpos == pfad->map_bytes - 1; + return pfad->fpos == pfad->map_bytes; } static int meta_close_cb(FLAC__IOHandle __a_unused handle)