summaryrefslogtreecommitdiff
path: root/libavformat/os_support.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-03-28 12:26:36 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-03-28 12:26:36 +0100
commitfd37a7dc3c1bc09e9f2367dc8487dd5cce9cf291 (patch)
tree85304419ac1351aea15f06af44e326a9a28de184 /libavformat/os_support.c
parente63ebaca16b7620441dda9e21b8773ef7e7ae2df (diff)
parentcf53704c55378cc0dcfc16637cdac7d58f0b3107 (diff)
downloadffmpeg-fd37a7dc3c1bc09e9f2367dc8487dd5cce9cf291.tar.gz
Merge commit 'cf53704c55378cc0dcfc16637cdac7d58f0b3107'
* commit 'cf53704c55378cc0dcfc16637cdac7d58f0b3107': AVOptions: make av_set_options_string() forward options to child objects win32: Use 64-bit fstat/lseek variants for MSVC as well win32: Make ff_win32_open more robust Conflicts: libavformat/os_support.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/os_support.c')
-rw-r--r--libavformat/os_support.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/os_support.c b/libavformat/os_support.c
index 0a901f6bd2..dc88834bf3 100644
--- a/libavformat/os_support.c
+++ b/libavformat/os_support.c
@@ -36,6 +36,7 @@
#include <io.h>
#include <windows.h>
#include <share.h>
+#include <errno.h>
int ff_win32_open(const char *filename_utf8, int oflag, int pmode)
{
@@ -48,8 +49,10 @@ int ff_win32_open(const char *filename_utf8, int oflag, int pmode)
if (num_chars <= 0)
goto fallback;
filename_w = av_mallocz(sizeof(wchar_t) * num_chars);
- if (!filename_w)
+ if (!filename_w) {
+ errno = ENOMEM;
return -1;
+ }
MultiByteToWideChar(CP_UTF8, 0, filename_utf8, -1, filename_w, num_chars);
fd = _wsopen(filename_w, oflag, SH_DENYNO, pmode);
@@ -59,7 +62,7 @@ int ff_win32_open(const char *filename_utf8, int oflag, int pmode)
return fd;
fallback:
- /* filename maybe be in CP_ACP */
+ /* filename may be be in CP_ACP */
return _sopen(filename_utf8, oflag, SH_DENYNO, pmode);
}
#endif