mirror of https://github.com/mpv-player/mpv
vd_lavc: check if av_device_ref is available
Fixes crashes when hwdevice failed to create. Fixes: #11769
This commit is contained in:
parent
eb4da3400a
commit
a5b9290261
|
@ -449,7 +449,9 @@ static AVBufferRef *hwdec_create_dev(struct mp_filter *vd,
|
|||
|
||||
const struct mp_hwdec_ctx *hw_ctx =
|
||||
hwdec_devices_get_by_imgfmt(ctx->hwdec_devs, imgfmt);
|
||||
return hw_ctx ? av_buffer_ref(hw_ctx->av_device_ref) : NULL;
|
||||
|
||||
if (hw_ctx && hw_ctx->av_device_ref)
|
||||
return av_buffer_ref(hw_ctx->av_device_ref);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in New Issue