[vlc-devel] commit: ogg: Fix a divide by zero. (Pierre d'Herbemont )
git version control
git at videolan.org
Sat Sep 27 19:41:59 CEST 2008
vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Sat Sep 27 19:44:39 2008 +0200| [15f7406ed966b9545e4fef5c38af73fa38aaff36] | committer: Pierre d'Herbemont
ogg: Fix a divide by zero.
Please review.
Spotted by llvm/clang checker.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=15f7406ed966b9545e4fef5c38af73fa38aaff36
---
modules/mux/ogg.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/modules/mux/ogg.c b/modules/mux/ogg.c
index 236b247..bc420a2 100644
--- a/modules/mux/ogg.c
+++ b/modules/mux/ogg.c
@@ -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 )
More information about the vlc-devel
mailing list