Commit 62eca2f8 authored by Michael Niedermayer's avatar Michael Niedermayer

avdevice/xcbgrab: Fix/remove unneeded NULL checks

Fixes CID1254664
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 374c907f
...@@ -596,7 +596,6 @@ static av_cold int xcbgrab_read_header(AVFormatContext *s) ...@@ -596,7 +596,6 @@ static av_cold int xcbgrab_read_header(AVFormatContext *s)
const xcb_setup_t *setup; const xcb_setup_t *setup;
char *display_name = av_strdup(s->filename); char *display_name = av_strdup(s->filename);
if (s->filename) {
if (!display_name) if (!display_name)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
...@@ -604,13 +603,12 @@ static av_cold int xcbgrab_read_header(AVFormatContext *s) ...@@ -604,13 +603,12 @@ static av_cold int xcbgrab_read_header(AVFormatContext *s)
*display_name = 0; *display_name = 0;
sscanf(s->filename, "+%d,%d", &c->x, &c->y); sscanf(s->filename, "+%d,%d", &c->x, &c->y);
} }
}
c->conn = xcb_connect(display_name, &screen_num); c->conn = xcb_connect(display_name, &screen_num);
av_freep(&display_name); av_freep(&display_name);
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) ? s->filename : "default", ret);
return AVERROR(EIO); return AVERROR(EIO);
} }
setup = xcb_get_setup(c->conn); setup = xcb_get_setup(c->conn);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment