[vlc-commits] adaptive: avoid a division by 0

Steve Lhomme git at videolan.org
Fri Jan 12 11:02:51 CET 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jan  2 16:38:51 2018 +0100| [f722ad55ef73f9d62316b9716e4c2663f55fe763] | committer: Jean-Baptiste Kempf

adaptive: avoid a division by 0

rate.time may not be set in some cases.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/demux/adaptive/http/Chunk.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/demux/adaptive/http/Chunk.cpp b/modules/demux/adaptive/http/Chunk.cpp
index a666069fca..fc167f04b9 100644
--- a/modules/demux/adaptive/http/Chunk.cpp
+++ b/modules/demux/adaptive/http/Chunk.cpp
@@ -354,7 +354,7 @@ void HTTPChunkBufferedSource::bufferize(size_t readsize)
         }
     }
 
-    if(rate.size)
+    if(rate.size && rate.time)
     {
         connManager->updateDownloadRate(sourceid, rate.size, rate.time);
     }



More information about the vlc-commits mailing list