mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
xcbgrab: Support empty filename string correctly
Bug-Id: CID 1254664 CC: libav-stable@libav.org
This commit is contained in:
parent
fa8934d6d6
commit
2c3f29c489
@ -594,10 +594,10 @@ static av_cold int xcbgrab_read_header(AVFormatContext *s)
|
|||||||
int screen_num, ret;
|
int screen_num, ret;
|
||||||
const xcb_setup_t *setup;
|
const xcb_setup_t *setup;
|
||||||
|
|
||||||
c->conn = xcb_connect(s->filename, &screen_num);
|
c->conn = xcb_connect(s->filename[0] ? s->filename : NULL, &screen_num);
|
||||||
if ((ret = xcb_connection_has_error(c->conn))) {
|
if ((ret = xcb_connection_has_error(c->conn))) {
|
||||||
av_log(s, AV_LOG_ERROR, "Cannot open display %s, error %d.\n",
|
av_log(s, AV_LOG_ERROR, "Cannot open display %s, error %d.\n",
|
||||||
s->filename ? s->filename : "default", ret);
|
s->filename[0] ? s->filename : "default", ret);
|
||||||
return AVERROR(EIO);
|
return AVERROR(EIO);
|
||||||
}
|
}
|
||||||
setup = xcb_get_setup(c->conn);
|
setup = xcb_get_setup(c->conn);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user