[libav-devel] [PATCH 2/2] ismindex: Avoid writing ismf files if no base name has been specified

Martin Storsjö martin at martin.st
Fri Sep 5 23:50:48 CEST 2014


On Fri, 5 Sep 2014, Timothy Gu wrote:

> On Fri, Sep 5, 2014 at 12:58 PM, Martin Storsjö <martin at martin.st> wrote:
>> Previously, this could create files named "(null).ismf", if the -ismf
>> parameter is specified (before an input file name), but without
>> specifying any base name.
>> ---
>>  tools/ismindex.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/tools/ismindex.c b/tools/ismindex.c
>> index bc98226..aa862f8 100644
>> --- a/tools/ismindex.c
>> +++ b/tools/ismindex.c
>> @@ -679,6 +679,8 @@ int main(int argc, char **argv)
>>          } else if (argv[i][0] == '-') {
>>              return usage(argv[0], 1);
>>          } else {
>> +            if (!basename)
>> +                ismf = 0;
>>              if (handle_file(&tracks, argv[i], split, ismf,
>>                              basename, output_prefix))
>>                  return 1;
>
> A warning would be helpful

A warning actually is printed, but further down:

     if (!tracks.nb_tracks || (!basename && !split))
         return usage(argv[0], 1);

This doesn't cover the pathological case if one has specified both split 
and ismf (which is a combination that doesn't make much sense either) but 
no basename though.

// Martin


More information about the libav-devel mailing list