Skip to content

Commit

Permalink
xcbgrab: Support empty filename string correctly
Browse files Browse the repository at this point in the history
Bug-Id: CID 1254664
CC: libav-stable@libav.org
  • Loading branch information
lu-zero committed Dec 10, 2014
1 parent fa8934d commit 2c3f29c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libavdevice/xcbgrab.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,10 +594,10 @@ static av_cold int xcbgrab_read_header(AVFormatContext *s)
int screen_num, ret;
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))) {
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);
}
setup = xcb_get_setup(c->conn);
Expand Down

0 comments on commit 2c3f29c

Please sign in to comment.