avutil/file_open: Use av_mallocz_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
e77ffaa0ac
commit
4aa7848eb8
@ -48,7 +48,7 @@ static int win32_open(const char *filename_utf8, int oflag, int pmode)
|
|||||||
num_chars = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, filename_utf8, -1, NULL, 0);
|
num_chars = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, filename_utf8, -1, NULL, 0);
|
||||||
if (num_chars <= 0)
|
if (num_chars <= 0)
|
||||||
goto fallback;
|
goto fallback;
|
||||||
filename_w = av_mallocz(sizeof(wchar_t) * num_chars);
|
filename_w = av_mallocz_array(num_chars, sizeof(wchar_t));
|
||||||
if (!filename_w) {
|
if (!filename_w) {
|
||||||
errno = ENOMEM;
|
errno = ENOMEM;
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user