[vlc-commits] [Git][videolan/vlc][master] videofilter: assert that the input chroma is known

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Oct 18 07:31:37 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
ab60b7cf by Tristan Matthews at 2023-10-18T07:11:23+00:00
videofilter: assert that the input chroma is known

This is a continuation of !4386 (see 7b47c92a788ed26ce6692b878c2eac1c6621f63f)

- - - - -


7 changed files:

- modules/video_filter/gradfun.c
- modules/video_filter/hqdn3d.c
- modules/video_filter/invert.c
- modules/video_filter/motionblur.c
- modules/video_filter/ripple.c
- modules/video_filter/scene.c
- modules/video_filter/wave.c


Changes:

=====================================
modules/video_filter/gradfun.c
=====================================
@@ -107,7 +107,8 @@ static int Open(filter_t *filter)
     const vlc_fourcc_t fourcc = filter->fmt_in.video.i_chroma;
 
     const vlc_chroma_description_t *chroma = vlc_fourcc_GetChromaDescription(fourcc);
-    if (!chroma || chroma->plane_count < 3 || chroma->pixel_size != 1) {
+    assert( chroma != NULL );
+    if (chroma->plane_count < 3 || chroma->pixel_size != 1) {
         msg_Err(filter, "Unsupported chroma (%4.4s)", (char*)&fourcc);
         return VLC_EGENERIC;
     }


=====================================
modules/video_filter/hqdn3d.c
=====================================
@@ -115,7 +115,8 @@ static int Open(filter_t *filter)
 
     const vlc_chroma_description_t *chroma =
             vlc_fourcc_GetChromaDescription(fourcc_in);
-    if (!chroma || chroma->plane_count != 3 || chroma->pixel_size != 1) {
+    assert( chroma != NULL );
+    if (chroma->plane_count != 3 || chroma->pixel_size != 1) {
         msg_Err(filter, "Unsupported chroma (%4.4s)", (char*)&fourcc_in);
         return VLC_EGENERIC;
     }


=====================================
modules/video_filter/invert.c
=====================================
@@ -67,7 +67,8 @@ static int Create( filter_t *p_filter )
 
     const vlc_chroma_description_t *p_chroma =
         vlc_fourcc_GetChromaDescription( fourcc );
-    if( p_chroma == NULL || p_chroma->plane_count == 0
+    assert( p_chroma != NULL );
+    if( p_chroma->plane_count == 0
      || p_chroma->pixel_size * 8 != p_chroma->pixel_bits )
         return VLC_EGENERIC;
 


=====================================
modules/video_filter/motionblur.c
=====================================
@@ -91,7 +91,8 @@ static int Create( filter_t *p_filter )
 {
     const vlc_chroma_description_t *p_chroma =
         vlc_fourcc_GetChromaDescription( p_filter->fmt_in.video.i_chroma );
-    if( p_chroma == NULL || p_chroma->plane_count == 0 )
+    assert( p_chroma != NULL );
+    if( p_chroma->plane_count == 0 )
         return VLC_EGENERIC;
 
     /* Allocate structure */


=====================================
modules/video_filter/ripple.c
=====================================
@@ -77,7 +77,8 @@ static int Create( filter_t *p_filter )
 {
     const vlc_chroma_description_t *p_chroma =
         vlc_fourcc_GetChromaDescription( p_filter->fmt_in.video.i_chroma );
-    if( p_chroma == NULL || p_chroma->plane_count == 0 )
+    assert( p_chroma != NULL );
+    if( p_chroma->plane_count == 0 )
         return VLC_EGENERIC;
 
     /* Allocate structure */


=====================================
modules/video_filter/scene.c
=====================================
@@ -155,7 +155,8 @@ static int Create( filter_t *p_filter )
 
     const vlc_chroma_description_t *p_chroma =
         vlc_fourcc_GetChromaDescription( p_filter->fmt_in.video.i_chroma );
-    if( p_chroma == NULL || p_chroma->plane_count == 0 )
+    assert( p_chroma != NULL );
+    if( p_chroma->plane_count == 0 )
         return VLC_EGENERIC;
 
     config_ChainParse( p_filter, CFG_PREFIX, ppsz_vfilter_options,


=====================================
modules/video_filter/wave.c
=====================================
@@ -77,7 +77,8 @@ static int Create( filter_t *p_filter )
 {
     const vlc_chroma_description_t *p_chroma =
         vlc_fourcc_GetChromaDescription( p_filter->fmt_in.video.i_chroma );
-    if( p_chroma == NULL || p_chroma->plane_count == 0 )
+    assert( p_chroma != NULL );
+    if( p_chroma->plane_count == 0 )
         return VLC_EGENERIC;
 
     /* Allocate structure */



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/ab60b7cf0482e8e50cf85ec88c91aff22c30fb76

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/ab60b7cf0482e8e50cf85ec88c91aff22c30fb76
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