From: Rob Clark Date: Mon, 23 Jul 2012 16:35:06 +0000 (-0500) Subject: modetest: fix uninitialized fourcc X-Git-Tag: accepted/2.0alpha-wayland/20121114.232726~48 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ebd7904877d08525beb5039e4ea2f5b6c0a7c23f;p=profile%2Fivi%2Flibdrm.git modetest: fix uninitialized fourcc If color format for CRTC layer is not specified on commandline, then c->fourcc is unintialized resulting in addfb call failing. Signed-off-by: Rob Clark --- diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index 3e74008..e0fd66c 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -867,12 +867,12 @@ static int parse_connector(struct connector *c, const char *arg) if (*p == '@') { strncpy(c->format_str, p + 1, 4); c->format_str[4] = '\0'; + } - c->fourcc = format_fourcc(p + 1); - if (c->fourcc == 0) { - fprintf(stderr, "unknown format %s\n", c->format_str); - return -1; - } + c->fourcc = format_fourcc(c->format_str); + if (c->fourcc == 0) { + fprintf(stderr, "unknown format %s\n", c->format_str); + return -1; } return 0;