From 15f7406ed966b9545e4fef5c38af73fa38aaff36 Mon Sep 17 00:00:00 2001 From: Pierre d'Herbemont Date: Sat, 27 Sep 2008 19:44:39 +0200 Subject: [PATCH] ogg: Fix a divide by zero. Please review. Spotted by llvm/clang checker. --- modules/mux/ogg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/mux/ogg.c b/modules/mux/ogg.c index 236b247de3..bc420a24bf 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 ) -- 2.39.5