Check for malloc failure.

This commit is contained in:
Ari Koivula 2014-04-03 13:32:56 +03:00
parent 313466fdff
commit f380e7d4b0

View file

@ -147,8 +147,9 @@ int main(int argc, char *argv[])
sprintf(dim_str, "_%dx%d.yuv", cfg->width, cfg->height);
left_len = strlen(cfg->debug);
right_len = strlen(dim_str);
realloc(cfg->debug, left_len + right_len + 1);
strcpy(cfg->debug + left_len, dim_str);
if (realloc(cfg->debug, left_len + right_len + 1)) {
strcpy(cfg->debug + left_len, dim_str);
}
}
// Do more validation to make sure the parameters we have make sense.