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 <rob@ti.com>
main
Rob Clark 2012-07-23 11:35:06 -05:00
parent db004badef
commit ebd7904877
1 changed files with 5 additions and 5 deletions

View File

@ -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;