]> git.sesse.net Git - vlc/commitdiff
ogg: Fix a divide by zero.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Sat, 27 Sep 2008 17:44:39 +0000 (19:44 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Sat, 27 Sep 2008 17:44:39 +0000 (19:44 +0200)
Please review.

Spotted by llvm/clang checker.

modules/mux/ogg.c

index 236b247de37a431fbbf8fea9b57175b77aae336a..bc420a24bf3774e6cb343dde602a6e0ecac5d81a 100644 (file)
@@ -872,6 +872,9 @@ static void OggSetDate( block_t *p_og, mtime_t i_dts, mtime_t i_length )
     {
         i_count++;
     }
+
+    if( i_count == 0 ) return; /* ignore. */
+
     i_delta = i_length / i_count;
 
     for( p_tmp = p_og; p_tmp != NULL; p_tmp = p_tmp->p_next )