When vulkan rendering is requested by the user and fails, ffplay should exit graciously instead of crash due to a null pointer deref.
Unified · Split
| @@ -2612,6 +2612,11 @@ static int create_hwaccel(AVBufferRef **device_ctx) · 2611 unmodified lines | ||
| 2612 | 2612 | if (type == AV_HWDEVICE_TYPE_NONE) |
| 2613 | 2613 | return AVERROR(ENOTSUP); |
| 2614 | 2614 | |
| 2615 | + if (!vk_renderer) { | |
| 2616 | + av_log(NULL, AV_LOG_ERROR, "Vulkan renderer is not available\n"); | |
| 2617 | + return AVERROR(ENOTSUP); | |
| 2618 | + } | |
| 2619 | + | |
| 2615 | 2620 | ret = vk_renderer_get_hw_dev(vk_renderer, &vk_dev); |
| 2616 | 2621 | if (ret < 0) |
| 2617 | 2622 | return ret; |