modetest: Fix segmentation fault

When a mode is set with just a connector "-s foo",
we get a nasty segmentation fault. Fix it.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
main
Ezequiel Garcia 2019-07-22 13:08:22 -03:00 committed by Emil Velikov
parent 899da0f486
commit 07d48a4c00
1 changed files with 2 additions and 0 deletions

View File

@ -1721,6 +1721,8 @@ static int parse_connector(struct pipe_arg *pipe, const char *arg)
return -1; return -1;
/* Parse the remaining parameters. */ /* Parse the remaining parameters. */
if (!endp)
return -1;
if (*endp == '@') { if (*endp == '@') {
arg = endp + 1; arg = endp + 1;
pipe->crtc_id = strtoul(arg, &endp, 10); pipe->crtc_id = strtoul(arg, &endp, 10);