[vlc-commits] [Git][videolan/vlc][3.0.x] 9 commits: access/dtv: fix mod leak

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Jan 18 06:48:21 UTC 2024



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
072a9d8c by Johannes Kauffmann at 2024-01-13T12:53:36+01:00
access/dtv: fix mod leak

(cherry picked from commit b945194f173247b5b812d6c99911dadc220a741e)

- - - - -
5a817a90 by Johannes Kauffmann at 2024-01-13T12:55:05+01:00
aout: file: remove free(NULL)

There used to be a test for a NULL char as well, but it was removed in
b1c459e9502282ad3bc94016e532a372f9c6955c.

(cherry picked from commit c3c9840bc78c80d24faf5bfa8f7610f51153568e)

- - - - -
5ff213d5 by Johannes Kauffmann at 2024-01-13T13:24:14+01:00
aout: file: fix psz_name leak

(cherry picked from commit 02d87cc92b9ad32966a2f68c9e1c84c9ea451bba)

- - - - -
03d1ab01 by Johannes Kauffmann at 2024-01-13T23:09:28+01:00
cli: fix two psz_unix_path leaks

This would be a cherry-pick of 5b79e0f9d0febc9be4a34966f920a4d0f6634dfe,
but on 3.0.x, unlike master, psz_unix_path doesn't leak in the error
condition before psz_unix_path is copied to struct addr, but in two
error conditions that occur when when listening to "rc-host" fails.

- - - - -
e49f8f31 by Johannes Kauffmann at 2024-01-13T23:09:33+01:00
dxva2_deinterlace: fix psz_mode leak

(cherry picked from commit ca51bd21b3a3935b74105a97fb09462ed0b7b91f)

- - - - -
ae50254b by Steve Lhomme at 2024-01-13T23:46:12+01:00
d3d11_deinterlace: log the filter that actually failed

Not the "auto" name.

(cherry picked from commit f00c62a88b74449d3983751b3ae3b7fddb51e7e7)

note: this commit was picked to allow picking the next commit, without
this one the next would cause a use-after-free.

- - - - -
f1f12386 by Johannes Kauffmann at 2024-01-13T23:46:53+01:00
d3d11_deinterlace: fix psz_mode leak

(cherry picked from commit 1ced6b100005511284f754932bf9a5dc32bf9abe)

- - - - -
8436f79c by Johannes Kauffmann at 2024-01-13T23:46:53+01:00
ntservice: fix psz_service leak

(cherry picked from commit 56837c1adcfcad8505d24ce90f9f365b9026b639)

- - - - -
50acae2b by Johannes Kauffmann at 2024-01-13T23:46:53+01:00
opencv_wrapper: fix psz_inner_name leak

(cherry picked from commit 24163ce0f43a21cdde08711a4a56ae37c8154ccf)

edited: use p_filter->p_sys instead of p_sys

- - - - -


7 changed files:

- modules/access/dtv/access.c
- modules/audio_output/file.c
- modules/control/ntservice.c
- modules/control/oldrc.c
- modules/hw/d3d11/d3d11_deinterlace.c
- modules/hw/d3d9/dxva2_deinterlace.c
- modules/video_filter/opencv_wrapper.c


Changes:

=====================================
modules/access/dtv/access.c
=====================================
@@ -692,7 +692,9 @@ static const char *var_InheritModulation (vlc_object_t *obj, const char *var)
         case 64:  str = "64QAM";  break;
         case 128: str = "128QAM"; break;
         case 256: str = "256QAM"; break;
-        default:  return "";
+        default:
+            free (mod);
+            return "";
     }
 
     msg_Warn (obj, "\"modulation=%s\" option is obsolete. "


=====================================
modules/audio_output/file.c
=====================================
@@ -142,14 +142,16 @@ static int Start( audio_output_t *p_aout, audio_sample_format_t *restrict fmt )
     if( !psz_name )
     {
         msg_Err( p_aout, "you need to specify an output file name" );
-        free( psz_name );
         return VLC_EGENERIC;
     }
 
     /* Allocate structure */
     p_aout->sys = malloc( sizeof( aout_sys_t ) );
     if( p_aout->sys == NULL )
+    {
+        free( psz_name );
         return VLC_ENOMEM;
+    }
 
     if( !strcmp( psz_name, "-" ) )
         p_aout->sys->p_file = stdout;


=====================================
modules/control/ntservice.c
=====================================
@@ -154,12 +154,14 @@ static void *Run( void *data )
     if( var_InheritBool( p_intf, "ntservice-install" ) )
     {
         NTServiceInstall( p_intf );
+        free( p_intf->p_sys->psz_service );
         return NULL;
     }
 
     if( var_InheritBool( p_intf, "ntservice-uninstall" ) )
     {
         NTServiceUninstall( p_intf );
+        free( p_intf->p_sys->psz_service );
         return NULL;
     }
 


=====================================
modules/control/oldrc.c
=====================================
@@ -310,6 +310,7 @@ static int Activate( vlc_object_t *p_this )
             if( asprintf( &psz_backward_compat_host, "//%s", psz_host ) < 0 )
             {
                 free( psz_host );
+                free( psz_unix_path );
                 return VLC_EGENERIC;
             }
             free( psz_host );
@@ -326,6 +327,7 @@ static int Activate( vlc_object_t *p_this )
                       url.psz_host, url.i_port );
             vlc_UrlClean( &url );
             free( psz_host );
+            free( psz_unix_path );
             return VLC_EGENERIC;
         }
 


=====================================
modules/hw/d3d11/d3d11_deinterlace.c
=====================================
@@ -449,6 +449,7 @@ int D3D11OpenDeinterlace(vlc_object_t *obj)
     }
     if (strcmp(p_mode->psz_mode, psz_mode))
         msg_Dbg(filter, "using %s deinterlacing mode", p_mode->psz_mode);
+    free(psz_mode);
 
     D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS rateCaps;
     for (UINT type = 0; type < processorCaps.RateConversionCapsCount; ++type)
@@ -466,7 +467,7 @@ int D3D11OpenDeinterlace(vlc_object_t *obj)
     if ( sys->videoProcessor==NULL &&
          p_mode->i_mode != D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS_DEINTERLACE_BOB )
     {
-        msg_Dbg(filter, "mode %s not available, trying bob", psz_mode);
+        msg_Dbg(filter, "mode %s not available, trying bob", p_mode->psz_mode);
         p_mode = GetFilterMode("bob");
         for (UINT type = 0; type < processorCaps.RateConversionCapsCount; ++type)
         {


=====================================
modules/hw/d3d9/dxva2_deinterlace.c
=====================================
@@ -434,6 +434,7 @@ int D3D9OpenDeinterlace(vlc_object_t *obj)
     }
     if (strcmp(p_mode->psz_mode, psz_mode))
         msg_Dbg(filter, "using %s deinterlacing mode", p_mode->psz_mode);
+    free(psz_mode);
 
     DXVA2_VideoProcessorCaps caps, best_caps;
     unsigned best_score = 0;


=====================================
modules/video_filter/opencv_wrapper.c
=====================================
@@ -268,6 +268,8 @@ static void Destroy( vlc_object_t *p_this )
     filter_t* p_filter = (filter_t*)p_this;
     ReleaseImages( p_filter );
 
+    free( p_filter->p_sys->psz_inner_name );
+
     // Release the internal OpenCV filter.
     module_unneed( p_filter->p_sys->p_opencv, p_filter->p_sys->p_opencv->p_module );
     vlc_object_release( p_filter->p_sys->p_opencv );



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/9134e2079b5a14ce852ceaf84515c8e4ae35580f...50acae2b5ba9ca47269f0fc228383a645d72242e

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/9134e2079b5a14ce852ceaf84515c8e4ae35580f...50acae2b5ba9ca47269f0fc228383a645d72242e
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list