Message ID | 20230413015356.44961-2-jamrial@gmail.com |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel,1/2] avformat/concatf: check if any nodes were allocated | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
diff --git a/libavutil/wchar_filename.h b/libavutil/wchar_filename.h index 9a04a069f1..27b93d0f89 100644 --- a/libavutil/wchar_filename.h +++ b/libavutil/wchar_filename.h @@ -32,7 +32,8 @@ static inline int utf8towchar(const char *filename_utf8, wchar_t **filename_w) num_chars = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, filename_utf8, -1, NULL, 0); if (num_chars <= 0) { *filename_w = NULL; - return 0; + errno = EINVAL; + return -1; } *filename_w = (wchar_t *)av_calloc(num_chars, sizeof(wchar_t)); if (!*filename_w) {
Don't return success if the string could not be converted. Signed-off-by: James Almer <jamrial@gmail.com> --- libavutil/wchar_filename.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)