[vlc-commits] stream_filter: httplive: don't trust stream size

Francois Cartegnie git at videolan.org
Wed Apr 22 14:58:48 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Apr 22 14:56:31 2015 +0200| [a13829b11afe1b56d5ecec4afa0b62b44af10739] | committer: Francois Cartegnie

stream_filter: httplive: don't trust stream size

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a13829b11afe1b56d5ecec4afa0b62b44af10739
---

 modules/stream_filter/httplive.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index aab46e0..4222c30 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -1887,7 +1887,8 @@ static int hls_Download(stream_t *s, segment_t *segment)
         }
 
         int i_canc = vlc_savecancel();
-        int i_length = stream_Read(p_ts, &p_segment_data->p_buffer[i_total_read], HLS_READ_SIZE);
+        int i_length = stream_Read(p_ts, &p_segment_data->p_buffer[i_total_read],
+                                   (i_toread >= HLS_READ_SIZE) ? HLS_READ_SIZE : i_toread);
         vlc_restorecancel(i_canc);
 
         if (i_length <= 0)



More information about the vlc-commits mailing list