Currently the file overwrite check does not work for paths that contain a colon. Use avio_find_protocol to always execute the existence check if the file protocol is going to be used. Fix remaining part of ticket #3249.
Unified · Split
| @@ -697,10 +697,9 @@ static void assert_file_overwrite(const char *filename) · 696 unmodified lines | |||
| 697 | exit_program(1); | 697 | exit_program(1); |
| 698 | } | 698 | } |
| 699 | 699 | ||
| 700 | if (!file_overwrite && | 700 | if (!file_overwrite) { |
| 701 | (strchr(filename, ':') == NULL || filename[1] == ':' || | 701 | const char *proto_name = avio_find_protocol_name(filename); |
| 702 | av_strstart(filename, "file:", NULL))) { | 702 | if (proto_name && !strcmp(proto_name, "file") && avio_check(filename, 0) == 0) { |
| 703 | if (avio_check(filename, 0) == 0) { | ||
| 704 | if (stdin_interaction && !no_file_overwrite) { | 703 | if (stdin_interaction && !no_file_overwrite) { |
| 705 | fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename); | 704 | fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename); |
| 706 | fflush(stderr); | 705 | fflush(stderr); |