[vlc-commits] packetizer: mpegvideo: check for overflow in rate
Francois Cartegnie
git at videolan.org
Wed Jul 19 11:31:06 CEST 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jul 19 10:55:04 2017 +0200| [ae3788b8021eb5caffba5eb3a40386b1c25b5668] | committer: Francois Cartegnie
packetizer: mpegvideo: check for overflow in rate
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ae3788b8021eb5caffba5eb3a40386b1c25b5668
---
modules/packetizer/mpegvideo.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/modules/packetizer/mpegvideo.c b/modules/packetizer/mpegvideo.c
index a538582322..42a8ebbabb 100644
--- a/modules/packetizer/mpegvideo.c
+++ b/modules/packetizer/mpegvideo.c
@@ -55,6 +55,8 @@
#include "packetizer_helper.h"
#include "startcode_helper.h"
+#include <limits.h>
+
#define SYNC_INTRAFRAME_TEXT N_("Sync on Intra Frame")
#define SYNC_INTRAFRAME_LONGTEXT N_("Normally the packetizer would " \
"sync on the next full frame. This flags instructs the packetizer " \
@@ -681,7 +683,7 @@ static block_t *ParseMPEGBlock( decoder_t *p_dec, block_t *p_frag )
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 )
+ p_sys->i_frame_rate && p_sys->i_frame_rate_base && p_sys->i_frame_rate <= UINT_MAX/2 )
{
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