libFLAC : Put upper bound on number of seek points.

Restrict number of seek points to 32768 total and a maximum of two per
second.

Ten hours of content is 36000 seconds which gives about one seek point
for every second for those ten hours. Also, having more than two seek
point per second makes little sense regardless of content length.

Without these restrictions flac-to-flac encoding of a malformed input
file (eg something generated with http://lcamtuf.coredump.cx/afl/)
can result in an attempt to generate a stupidly large number of seek
points and cause an allocation failure.
diff --git a/src/libFLAC/metadata_object.c b/src/libFLAC/metadata_object.c
index 0456297..f9515f3 100644
--- a/src/libFLAC/metadata_object.c
+++ b/src/libFLAC/metadata_object.c
@@ -1128,6 +1128,13 @@
 		if(total_samples % samples == 0)
 			num--;
 
+		/* Put a strict upper bound on he number of allows seekpoints. */
+		if (num > 32768) {
+			/* Set the bound and recalculate samples accordingly. */
+			num = 32786;
+			samples = total_samples / num;
+		}
+
 		i = seek_table->num_points;
 
 		if(!FLAC__metadata_object_seektable_resize_points(object, seek_table->num_points + (unsigned)num))