[vlc-commits] bluray: fix division by zero

Petri Hintukainen git at videolan.org
Sat Feb 8 14:26:08 CET 2014


vlc | branch: master | Petri Hintukainen <phintuka at users.sourceforge.net> | Sat Feb  8 11:57:36 2014 +0000| [dbccf39c3e270741e7dc916d2bdd43fcd7388637] | committer: Jean-Baptiste Kempf

bluray: fix division by zero

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

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

 modules/access/bluray.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index 74563e7..4e0e816 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -1331,8 +1331,8 @@ static int blurayControl(demux_t *p_demux, int query, va_list args)
     case DEMUX_GET_POSITION:
     {
         double *pf_position = (double*)va_arg(args, double *);
-        *pf_position = p_demux->info.i_title < (int)p_sys->i_title ?
-                    (double)FROM_TICKS(bd_tell_time(p_sys->bluray))/CUR_LENGTH : 0.0;
+        *pf_position = p_demux->info.i_title < (int)p_sys->i_title && CUR_LENGTH > 0 ?
+                      (double)FROM_TICKS(bd_tell_time(p_sys->bluray))/CUR_LENGTH : 0.0;
         return VLC_SUCCESS;
     }
     case DEMUX_SET_POSITION:



More information about the vlc-commits mailing list