[FFmpeg-devel] [PATCH] avutil/wchar_filename: re-introduce explicit cast of void* to char*

Marton Balint cus at passwd.hu
Fri Oct 25 21:21:48 EEST 2024



On Tue, 22 Oct 2024, Marton Balint wrote:

> Fixes compile error on windows with decklink:
>
> In file included from ./libavformat/os_support.h:175,
>                 from ./libavformat/internal.h:30,
>                 from libavdevice/decklink_common.cpp:25:
> ./libavutil/wchar_filename.h: In function 'int wchartocp(unsigned int, const wchar_t*, char**)':
> ./libavutil/wchar_filename.h:59:32: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
>   59 |     *filename = av_malloc_array(num_chars, sizeof **filename);
>      |                 ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>      |                                |
>      |                                void*
>
> Regression since e9e8bea2e79bc3c481a6f81f75f6c871e3e0f367.
>
> Fixes ticket #11103.

Will apply and backport.

Regards,
Marton

>
> Signed-off-by: Marton Balint <cus at passwd.hu>
> ---
> libavutil/wchar_filename.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavutil/wchar_filename.h b/libavutil/wchar_filename.h
> index 23cc92aa2d..1370a084c9 100644
> --- a/libavutil/wchar_filename.h
> +++ b/libavutil/wchar_filename.h
> @@ -57,7 +57,7 @@ static inline int wchartocp(unsigned int code_page, const wchar_t *filename_w,
>         errno = EINVAL;
>         return -1;
>     }
> -    *filename = av_malloc_array(num_chars, sizeof **filename);
> +    *filename = (char *)av_malloc_array(num_chars, sizeof **filename);
>     if (!*filename) {
>         errno = ENOMEM;
>         return -1;
> -- 
> 2.43.0
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>


More information about the ffmpeg-devel mailing list