[vlc-commits] [Git][videolan/vlc][3.0.x] 5 commits: input: fix incompatible-pointer-types assignment

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Dec 6 12:42:27 UTC 2023



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


Commits:
1e291811 by Thomas Guillem at 2023-12-05T09:23:35+01:00
input: fix incompatible-pointer-types assignment

Fixes #28441

- - - - -
adcf4e66 by Zhao Zhili at 2023-12-05T13:02:52+01:00
yadif: fix variable type

Signed-off-by: Thomas Guillem <thomas at gllm.fr>
(cherry picked from commit 77b86f4452be4dbe0d56a9cd1b66da61b116da60)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

- - - - -
45198e53 by Rémi Denis-Courmont at 2023-12-05T13:03:00+01:00
swscale: avoid invalid pointer conversion

(cherry picked from commit ab00e6c59d42e05ab08893091783d8b5febc0058)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

- - - - -
4431076a by Rémi Denis-Courmont at 2023-12-05T13:04:01+01:00
dynamicoverlay: fix variable shadowing

(cherry picked from commit d42e05d6b2c061ae352c131d5aebf8c8d8aa6d35)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

- - - - -
fda14fc7 by Rémi Denis-Courmont at 2023-12-05T13:04:11+01:00
dynamicoverlay: fix memory corruption

Font alpha is 8-bits, not 32-bits.

(cherry picked from commit 6f14081af7325d334a53126c4eea52bc30fc08a0)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

- - - - -


4 changed files:

- modules/spu/dynamicoverlay/dynamicoverlay_commands.c
- modules/video_chroma/swscale.c
- modules/video_filter/deinterlace/yadif.h
- src/input/input_internal.h


Changes:

=====================================
modules/spu/dynamicoverlay/dynamicoverlay_commands.c
=====================================
@@ -234,8 +234,12 @@ static int parser_SetTextAlpha( char *psz_command, char *psz_end,
     skip_space( &psz_command );
     if( isdigit( (unsigned char)*psz_command ) )
     {
-        if( parse_digit( &psz_command, &p_params->fontstyle.i_font_alpha ) == VLC_EGENERIC )
+        int32_t value;
+
+        if( parse_digit( &psz_command, &value ) == VLC_EGENERIC )
             return VLC_EGENERIC;
+
+        p_params->fontstyle.i_font_alpha = value;
     }
     return VLC_SUCCESS;
 }
@@ -899,12 +903,11 @@ static const commanddesc_static_t p_commands[] =
 void RegisterCommand( filter_t *p_filter )
 {
     filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
-    size_t i_index = 0;
 
     p_sys->i_commands = ARRAY_SIZE(p_commands);
     p_sys->pp_commands = (commanddesc_t **) calloc( p_sys->i_commands, sizeof(commanddesc_t*) );
     if( !p_sys->pp_commands ) return;
-    for( i_index = 0; i_index < p_sys->i_commands; i_index ++ )
+    for( size_t i_index = 0; i_index < p_sys->i_commands; i_index ++ )
     {
         p_sys->pp_commands[i_index] = (commanddesc_t *) malloc( sizeof(commanddesc_t) );
         if( !p_sys->pp_commands[i_index] ) return;


=====================================
modules/video_chroma/swscale.c
=====================================
@@ -588,8 +588,9 @@ static void Convert( filter_t *p_filter, struct SwsContext *ctx,
 {
     filter_sys_t *p_sys = p_filter->p_sys;
     uint8_t palette[AVPALETTE_SIZE];
-    uint8_t *src[4]; int src_stride[4];
-    uint8_t *dst[4]; int dst_stride[4];
+    uint8_t *src[4], *dst[4];
+    const uint8_t *csrc[4];
+    int src_stride[4], dst_stride[4];
 
     GetPixels( src, src_stride, p_sys->desc_in, &p_filter->fmt_in.video,
                p_src, i_plane_count, b_swap_uvi );
@@ -606,11 +607,14 @@ static void Convert( filter_t *p_filter, struct SwsContext *ctx,
     GetPixels( dst, dst_stride, p_sys->desc_out, &p_filter->fmt_out.video,
                p_dst, i_plane_count, b_swap_uvo );
 
+    for (size_t i = 0; i < ARRAY_SIZE(src); i++)
+        csrc[i] = src[i];
+
 #if LIBSWSCALE_VERSION_INT  >= ((0<<16)+(5<<8)+0)
-    sws_scale( ctx, src, src_stride, 0, i_height,
+    sws_scale( ctx, csrc, src_stride, 0, i_height,
                dst, dst_stride );
 #else
-    sws_scale_ordered( ctx, src, src_stride, 0, i_height,
+    sws_scale_ordered( ctx, csrc, src_stride, 0, i_height,
                        dst, dst_stride );
 #endif
 }


=====================================
modules/video_filter/deinterlace/yadif.h
=====================================
@@ -140,10 +140,10 @@ static void yadif_filter_line_c(uint8_t *dst, uint8_t *prev, uint8_t *cur, uint8
 }
 
 static void yadif_filter_line_c_16bit(uint8_t *dst8, uint8_t *prev8, uint8_t *cur8, uint8_t *next8, int w, int prefs, int mrefs, int parity, int mode) {
-    uint8_t *dst = (uint8_t *)dst8;
-    uint8_t *prev = (uint8_t *)prev8;
-    uint8_t *cur = (uint8_t *)cur8;
-    uint8_t *next = (uint8_t *)next8;
+    uint16_t *dst = (uint16_t *)dst8;
+    uint16_t *prev = (uint16_t *)prev8;
+    uint16_t *cur = (uint16_t *)cur8;
+    uint16_t *next = (uint16_t *)next8;
     int x;
     uint16_t *prev2= parity ? prev : cur ;
     uint16_t *next2= parity ? cur  : next;


=====================================
src/input/input_internal.h
=====================================
@@ -117,7 +117,7 @@ typedef struct input_thread_private_t
 
     /* Title infos FIXME multi-input (not easy) ? */
     int          i_title;
-    const input_title_t **title;
+    input_title_t * const *title;
 
     int i_title_offset;
     int i_seekpoint_offset;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/5d465814936c29a935bacb29810e6355d444d4b7...fda14fc7c013eb75291df10cc8b88336c51328ad

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/5d465814936c29a935bacb29810e6355d444d4b7...fda14fc7c013eb75291df10cc8b88336c51328ad
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