[vlc-commits] packetizer: hevc: fix divbyzero

Francois Cartegnie git at videolan.org
Wed Jul 19 10:34:02 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jul 19 10:33:04 2017 +0200| [4b76784615f74254a7b66e34ff78393b44af2ed5] | committer: Francois Cartegnie

packetizer: hevc: fix divbyzero

num being used as den in date operations

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

 modules/packetizer/hevc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/packetizer/hevc.c b/modules/packetizer/hevc.c
index 39a85567b7..3e104ec859 100644
--- a/modules/packetizer/hevc.c
+++ b/modules/packetizer/hevc.c
@@ -189,7 +189,8 @@ static int Open(vlc_object_t *p_this)
     p_dec->fmt_out.b_packetized = true;
 
     /* Init timings */
-    if( p_dec->fmt_in.video.i_frame_rate_base > 0 )
+    if( p_dec->fmt_in.video.i_frame_rate_base &&
+        p_dec->fmt_in.video.i_frame_rate )
         date_Init( &p_sys->dts, p_dec->fmt_in.video.i_frame_rate * 2,
                                 p_dec->fmt_in.video.i_frame_rate_base );
     else



More information about the vlc-commits mailing list