diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-11-16 19:01:10 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-11-16 19:01:10 +0100 |
commit | 62eca2f827d441f52125191fd78c96b67a7ba30c (patch) | |
tree | 27a8f35e2e25bee1a905d510cb214ab3b3c4c01a /libavdevice | |
parent | 374c907fb35f8236547b24d792fbb9bed201e321 (diff) | |
download | ffmpeg-streaming-62eca2f827d441f52125191fd78c96b67a7ba30c.zip ffmpeg-streaming-62eca2f827d441f52125191fd78c96b67a7ba30c.tar.gz |
avdevice/xcbgrab: Fix/remove unneeded NULL checks
Fixes CID1254664
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavdevice')
-rw-r--r-- | libavdevice/xcbgrab.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/libavdevice/xcbgrab.c b/libavdevice/xcbgrab.c index 2fdb992..1657b7d 100644 --- a/libavdevice/xcbgrab.c +++ b/libavdevice/xcbgrab.c @@ -596,21 +596,19 @@ static av_cold int xcbgrab_read_header(AVFormatContext *s) const xcb_setup_t *setup; char *display_name = av_strdup(s->filename); - if (s->filename) { - if (!display_name) - return AVERROR(ENOMEM); + if (!display_name) + return AVERROR(ENOMEM); - if (!sscanf(s->filename, "%[^+]+%d,%d", display_name, &c->x, &c->y)) { - *display_name = 0; - sscanf(s->filename, "+%d,%d", &c->x, &c->y); - } + if (!sscanf(s->filename, "%[^+]+%d,%d", display_name, &c->x, &c->y)) { + *display_name = 0; + sscanf(s->filename, "+%d,%d", &c->x, &c->y); } c->conn = xcb_connect(display_name, &screen_num); av_freep(&display_name); 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) ? s->filename : "default", ret); return AVERROR(EIO); } setup = xcb_get_setup(c->conn); |