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

Francois Cartegnie git at videolan.org
Wed Apr 22 16:37:56 CEST 2015


vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Apr 22 14:56:31 2015 +0200| [de63839eeae5053af09834c8d70dd373ab2e2a7a] | committer: Jean-Baptiste Kempf

stream_filter: httplive: don't trust stream size

(cherry picked from commit a13829b11afe1b56d5ecec4afa0b62b44af10739)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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 035c367..45f908a 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -1881,7 +1881,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