History

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.

Leandro Santiago committed 2 years ago

Commit fd0cacc1 parent 7b209851 file · +5 −0Browse files

Unified · Split

fftools/ffplay.c+5−0
@@ -2612,6 +2612,11 @@ static int create_hwaccel(AVBufferRef **device_ctx) · 2611 unmodified lines
26122612 if (type == AV_HWDEVICE_TYPE_NONE)
26132613 return AVERROR(ENOTSUP);
26142614
2615+ if (!vk_renderer) {
2616+ av_log(NULL, AV_LOG_ERROR, "Vulkan renderer is not available\n");
2617+ return AVERROR(ENOTSUP);
2618+ }
2619+
26152620 ret = vk_renderer_get_hw_dev(vk_renderer, &vk_dev);
26162621 if (ret < 0)
26172622 return ret;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t