[vlc-commits] MLP packetizer: avoid SIGFPE with samplerate of 0

Jean-Baptiste Kempf git at videolan.org
Mon Oct 14 18:56:16 CEST 2013


vlc/vlc-2.0 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Oct  6 18:11:32 2013 +0200| [86d56b11d874030a13a5ae7fa7f92c37107f9175] | committer: Jean-Baptiste Kempf

MLP packetizer: avoid SIGFPE with samplerate of 0

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

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

 modules/packetizer/mlp.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/packetizer/mlp.c b/modules/packetizer/mlp.c
index de4c3f5..4d5229e 100644
--- a/modules/packetizer/mlp.c
+++ b/modules/packetizer/mlp.c
@@ -294,9 +294,12 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
                 msg_Info( p_dec, "MLP channels: %d samplerate: %d",
                           p_sys->mlp.i_channels, p_sys->mlp.i_rate );
 
-                const mtime_t i_end_date = date_Get( &p_sys->end_date );
-                date_Init( &p_sys->end_date, p_sys->mlp.i_rate, 1 );
-                date_Set( &p_sys->end_date, i_end_date );
+                if( p_sys->mlp.i_rate > 0 )
+                {
+                    const mtime_t i_end_date = date_Get( &p_sys->end_date );
+                    date_Init( &p_sys->end_date, p_sys->mlp.i_rate, 1 );
+                    date_Set( &p_sys->end_date, i_end_date );
+                }
             }
 
             p_dec->fmt_out.audio.i_rate     = p_sys->mlp.i_rate;



More information about the vlc-commits mailing list