[FFmpeg-devel] [PATCH v2] fftools/ffplay: fix crash when vk renderer is null

Zhao Zhili quinkblack at foxmail.com
Wed Nov 6 11:19:40 EET 2024



> On Nov 1, 2024, at 04:50, Leandro Santiago <leandrosansilva at gmail.com> wrote:
> 
> When vulkan rendering is requested by the user and fails, ffplay should
> exit graciously instead of crash due to a null pointer deref.
> 
> Signed-off-by: Leandro Santiago <leandrosansilva at gmail.com>
> ---
> fftools/ffplay.c | 5 +++++
> 1 file changed, 5 insertions(+)
> 
> diff --git a/fftools/ffplay.c b/fftools/ffplay.c
> index a596972769..56d0a36ca1 100644
> --- a/fftools/ffplay.c
> +++ b/fftools/ffplay.c
> @@ -2612,6 +2612,11 @@ static int create_hwaccel(AVBufferRef **device_ctx)
>     if (type == AV_HWDEVICE_TYPE_NONE)
>         return AVERROR(ENOTSUP);
> 
> +    if (!vk_renderer) {
> +        av_log(NULL, AV_LOG_ERROR, "Vulkan renderer is not available\n");
> +        return AVERROR(ENOTSUP);
> +    }
> +
>     ret = vk_renderer_get_hw_dev(vk_renderer, &vk_dev);
>     if (ret < 0)
>         return ret;

Applied and cherry-picked to release 7.0 and 7.1 branches, thanks!

> -- 
> 2.46.1
> 
> _______________________________________________
> 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