From 326920a9bf76be562ae65c55609edf65072129ad Mon Sep 17 00:00:00 2001 From: rr- Date: Mon, 20 Feb 2017 14:14:35 +0100 Subject: vo_tct: check ioctl result --- video/out/vo_tct.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'video/out/vo_tct.c') diff --git a/video/out/vo_tct.c b/video/out/vo_tct.c index 68b29e9bc8..dbe5d69fb6 100644 --- a/video/out/vo_tct.c +++ b/video/out/vo_tct.c @@ -177,14 +177,14 @@ static void write_half_blocks( static void get_win_size(struct vo *vo, int *out_width, int *out_height) { struct priv *p = vo->priv; -#if HAVE_POSIX - struct winsize winsize; - ioctl(STDOUT_FILENO, TIOCGWINSZ, &winsize); - *out_width = winsize.ws_col; - *out_height = winsize.ws_row; -#else *out_width = DEFAULT_WIDTH; *out_height = DEFAULT_HEIGHT; +#if HAVE_POSIX + struct winsize winsize; + if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &winsize) >= 0) { + *out_width = winsize.ws_col; + *out_height = winsize.ws_row; + } #endif if (p->opts->width > 0) -- cgit v1.2.3