From 036e9fd046c841e7c6c1c67ecc91039c3aa2b05f Mon Sep 17 00:00:00 2001 From: Josh Coalson Date: Thu, 16 Nov 2006 01:21:22 +0000 Subject: [PATCH] fix bug with -S # where the sample number >= total samples, is not getting converted to a placeholder point --- src/share/grabbag/seektable.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/share/grabbag/seektable.c b/src/share/grabbag/seektable.c index 12644206..4594c6c0 100644 --- a/src/share/grabbag/seektable.c +++ b/src/share/grabbag/seektable.c @@ -86,7 +86,10 @@ FLAC__bool grabbag__seektable_convert_specification_to_template(const char *spec #else const FLAC__int64 n = (FLAC__int64)strtoll(pt, &endptr, 10); #endif - if(n > 0 || (endptr > pt && *endptr == ';')) + if( + (n > 0 || (endptr > pt && *endptr == ';')) && /* is a valid number (extra check needed for "0") */ + (total_samples_to_encode == 0 || (FLAC__uint64)n < total_samples_to_encode) /* number is not >= the known total_samples_to_encode */ + ) if(!FLAC__metadata_object_seektable_template_append_point(seektable_template, (FLAC__uint64)n)) return false; }