diff --git a/libavdevice/xv.c b/libavdevice/xv.c index ad604825f2..a4b44c8eda 100644 --- a/libavdevice/xv.c +++ b/libavdevice/xv.c @@ -149,6 +149,10 @@ static int xv_write_header(AVFormatContext *s) ret = AVERROR_EXTERNAL; goto fail; } + if (!num_adaptors) { + av_log(s, AV_LOG_ERROR, "No X-Video adaptors present\n"); + return AVERROR(ENODEV); + } xv->xv_port = ai[0].base_id; XvFreeAdaptorInfo(ai);