summaryrefslogtreecommitdiffstats
path: root/play
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-11-19 20:05:29 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-11-19 20:05:29 +0000
commitef684b03c2713959fc3eaa04e38b5ba08cafd35c (patch)
tree260afc8bad55689873b47c6918b14685dadd885f /play
parent0be17796f18aa008b93d461a2f932f40e9606a24 (diff)
downloadampache-ef684b03c2713959fc3eaa04e38b5ba08cafd35c.tar.gz
ampache-ef684b03c2713959fc3eaa04e38b5ba08cafd35c.tar.bz2
ampache-ef684b03c2713959fc3eaa04e38b5ba08cafd35c.zip
prevent fread($fp,0) if a program seeks to the very end of a file
Diffstat (limited to 'play')
-rw-r--r--play/index.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/play/index.php b/play/index.php
index a4a73b45..f8d0dd6a 100644
--- a/play/index.php
+++ b/play/index.php
@@ -352,7 +352,9 @@ $min_bytes_streamed = $song->size / 2;
// Actually do the streaming
do {
- $buf = fread($fp, min(2048,$stream_size-$bytes_streamed));
+ $read_size = min(2048,$stream_size-$bytes_streamed);
+ if ($read_size < 1) { break; }
+ $buf = fread($fp, $read_size);
print($buf);
$bytes_streamed += strlen($buf);
} while (!feof($fp) && (connection_status() == 0) AND $bytes_streamed < $stream_size);