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

Marvin Scholz epirat07 at gmail.com
Wed Dec 11 18:51:10 CET 2019


---
Could not test this change, as video filters are currently
somehow broken on macOS so there was no way to make VLC use
that filter...
---
 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 9aea2dd468..99e13bc009 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 );
-- 
2.20.1 (Apple Git-117)



More information about the vlc-devel mailing list