Commit 7e7b4030 authored by Florent Le Coz's avatar Florent Le Coz Committed by Max Kellermann

Construct a Null AllocatedPath if the filename conversion into UTF8 failed

parent c64ad78c
ver 0.18.18 (not yet released) ver 0.18.18 (not yet released)
* decoder * decoder
- ffmpeg: support opus - ffmpeg: support opus
* fix crash on failed filename charset conversion
ver 0.18.17 (2014/11/02) ver 0.18.17 (2014/11/02)
* playlist * playlist
......
...@@ -46,7 +46,11 @@ AllocatedPath::Build(const_pointer a, const_pointer b) ...@@ -46,7 +46,11 @@ AllocatedPath::Build(const_pointer a, const_pointer b)
AllocatedPath AllocatedPath
AllocatedPath::FromUTF8(const char *path_utf8) AllocatedPath::FromUTF8(const char *path_utf8)
{ {
return AllocatedPath(Donate(), ::PathFromUTF8(path_utf8)); char *path = ::PathFromUTF8(path_utf8);
if (path == nullptr)
return AllocatedPath::Null();
return AllocatedPath(Donate(), path);
} }
AllocatedPath AllocatedPath
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment