mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-12-24 11:52:06 +08:00
fftools/ffplay: fix crash when vk renderer is null
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@gmail.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
(cherry picked from commit fd0cacc472)
This commit is contained in:
committed by
Zhao Zhili
parent
d63f7ddebc
commit
786d4af405
@@ -2605,6 +2605,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;
|
||||
|
||||
Reference in New Issue
Block a user