avformat/file: Fix file delete for Windows
authorKarthick Jeyapal <kjeyapal@akamai.com>
Mon, 31 Dec 2018 07:37:49 +0000 (13:07 +0530)
committerKarthick J <kjeyapal@akamai.com>
Mon, 7 Jan 2019 06:11:20 +0000 (11:41 +0530)
Fixes bug id : 7638

libavformat/file.c

index 1d321c4..e613b91 100644 (file)
@@ -173,7 +173,11 @@ static int file_delete(URLContext *h)
     av_strstart(filename, "file:", &filename);
 
     ret = rmdir(filename);
-    if (ret < 0 && errno == ENOTDIR)
+    if (ret < 0 && (errno == ENOTDIR
+#   ifdef _WIN32
+        || errno == EINVAL
+#   endif
+        ))
         ret = unlink(filename);
     if (ret < 0)
         return AVERROR(errno);