changeset 1259:690659633ec5

- Fix endless looping on certain unparseable streams
author Ralf Ertzinger <ralf@skytale.net>
date Fri, 13 Jul 2007 16:34:54 +0200
parents 486bbb62c3c1
children df8673a3e2f3
files src/flacng/seekable_stream_callbacks.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/flacng/seekable_stream_callbacks.c	Fri Jul 13 14:36:28 2007 +0200
+++ b/src/flacng/seekable_stream_callbacks.c	Fri Jul 13 16:34:54 2007 +0200
@@ -138,6 +138,16 @@
     info = (callback_info*) client_data;
     _DEBUG("Using callback_info %s", info->name);
 
+    /*
+     * If we are testing a stream and use restricted reading,
+     * return EOF if we have exhausted our alotted reading
+     * quota
+     */
+    if (0 == info->read_max) {
+        _DEBUG("read_max exhausted, faking EOF");
+        return TRUE;
+    }
+
     eof = vfs_feof(info->input_stream);
 
     _LEAVE eof;