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 | 697 | exit_program(1); |
| 698 | 698 | } |
| 699 | 699 | |
| 700 | − if (!file_overwrite && | |
| 701 | − (strchr(filename, ':') == NULL || filename[1] == ':' || | |
| 702 | − av_strstart(filename, "file:", NULL))) { | |
| 703 | − if (avio_check(filename, 0) == 0) { | |
| 700 | + if (!file_overwrite) { | |
| 701 | + const char *proto_name = avio_find_protocol_name(filename); | |
| 702 | + if (proto_name && !strcmp(proto_name, "file") && avio_check(filename, 0) == 0) { | |
| 704 | 703 | if (stdin_interaction && !no_file_overwrite) { |
| 705 | 704 | fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename); |
| 706 | 705 | fflush(stderr); |