[vlc-commits] packetizer: mpegvideo: fix divbyzero
Francois Cartegnie
git at videolan.org
Mon Apr 17 16:08:23 CEST 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Apr 17 16:05:39 2017 +0200| [4a4e0c58606dccbb829e726337e0d688eb35adb6] | committer: Francois Cartegnie
packetizer: mpegvideo: fix divbyzero
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4a4e0c58606dccbb829e726337e0d688eb35adb6
---
modules/packetizer/mpegvideo.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/modules/packetizer/mpegvideo.c b/modules/packetizer/mpegvideo.c
index 39c94a4afe..67dd1bbee8 100644
--- a/modules/packetizer/mpegvideo.c
+++ b/modules/packetizer/mpegvideo.c
@@ -661,8 +661,9 @@ static block_t *ParseMPEGBlock( decoder_t *p_dec, block_t *p_frag )
p_sys->i_frame_rate_base =
code_to_frame_rate[p_frag->p_buffer[7]&0x0f][1];
- if( p_sys->i_frame_rate != p_dec->fmt_out.video.i_frame_rate ||
- p_dec->fmt_out.video.i_frame_rate_base != p_sys->i_frame_rate_base )
+ if( ( p_sys->i_frame_rate != p_dec->fmt_out.video.i_frame_rate ||
+ p_dec->fmt_out.video.i_frame_rate_base != p_sys->i_frame_rate_base ) &&
+ p_sys->i_frame_rate && p_sys->i_frame_rate_base )
{
date_Change( &p_sys->dts, 2 * p_sys->i_frame_rate, p_sys->i_frame_rate_base );
date_Change( &p_sys->prev_iframe_dts, 2 * p_sys->i_frame_rate, p_sys->i_frame_rate_base );
More information about the vlc-commits
mailing list