[vlc-devel] [PATCH 2/3] transcode: video: don't drain the secondary filters

Steve Lhomme robux4 at ycbcr.xyz
Wed Oct 7 14:02:26 CEST 2020


The second loop is never looping since on the second call p_in is NULL,
resulting in the "secondary_chains" loop not being used and thus p_in remains
NULL.

Most filters can't handle a NULL input anyway so it could potentially crash.
---
 modules/stream_out/transcode/video.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
index e699a558145..144856fb79a 100644
--- a/modules/stream_out/transcode/video.c
+++ b/modules/stream_out/transcode/video.c
@@ -596,8 +596,6 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
             if( !p_in )
                 break;
 
-            for ( ;; p_in = NULL /* drain second time */ )
-            {
                 /* Run user specified filter chain */
                 filter_chain_t * secondary_chains[] = { id->p_uf_chain,
                                                         id->p_final_conv_static };
@@ -612,7 +610,6 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
                     break;
 
                 encode_filtered( id, out, p_in );
-            }
         }
 
         if( b_eos )
-- 
2.26.2



More information about the vlc-devel mailing list