[vlc-commits] video_filter/fps: Prevent division by 0

Marvin Scholz git at videolan.org
Fri Dec 13 13:30:09 CET 2019


vlc/vlc-3.0 | branch: master | Marvin Scholz <epirat07 at gmail.com> | Wed Dec 11 18:23:02 2019 +0100| [46d459f405b19764e23b622fd2e07ca7b28b5186] | committer: Marvin Scholz

video_filter/fps: Prevent division by 0

(cherry picked from commit e037f2129ec6432db6a13a6632bd36290e920ac9)
Signed-off-by: Marvin Scholz <epirat07 at gmail.com>

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

 modules/video_filter/fps.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/video_filter/fps.c b/modules/video_filter/fps.c
index d8a6c14a89..047afe6a44 100644
--- a/modules/video_filter/fps.c
+++ b/modules/video_filter/fps.c
@@ -160,6 +160,12 @@ static int Open( vlc_object_t *p_this)
         p_filter->fmt_out.video.i_frame_rate_base = i_out_frame_rate_base;
     }
 
+    if( p_filter->fmt_out.video.i_frame_rate == 0 ) {
+        msg_Err( p_filter, "Invalid output frame rate" );
+        free( p_sys );
+        return VLC_EGENERIC;
+    }
+
     msg_Dbg( p_filter, "Converting fps from %d/%d -> %d/%d",
             p_filter->fmt_in.video.i_frame_rate, p_filter->fmt_in.video.i_frame_rate_base,
             p_filter->fmt_out.video.i_frame_rate, p_filter->fmt_out.video.i_frame_rate_base );



More information about the vlc-commits mailing list