[util] Fix crash when --output-file is specified but not --output-format

This commit is contained in:
Behdad Esfahbod 2015-11-10 11:37:01 -08:00
parent d5f0d7c9fb
commit e97835ad43
1 changed files with 3 additions and 0 deletions

View File

@ -401,7 +401,10 @@ struct output_options_t : option_group_t
if (output_file && !output_format) {
output_format = strrchr (output_file, '.');
if (output_format)
{
output_format++; /* skip the dot */
output_format = strdup (output_format);
}
}
if (output_file && 0 == strcmp (output_file, "-"))