loader/svg: If link string is empty, not create picture object

An empty link causes the wrong loader to be found and causes various problems.

related issue : https://github.com/thorvg/thorvg/issues/2078#issuecomment-2067726046
This commit is contained in:
JunsuChoi 2024-04-24 20:47:29 +09:00 committed by Hermet Park
parent 9183f1c11e
commit a1ffa039bb

View file

@ -557,7 +557,7 @@ static bool _isValidImageMimeTypeAndEncoding(const char** href, const char** mim
static unique_ptr<Picture> _imageBuildHelper(SvgLoaderData& loaderData, SvgNode* node, const Box& vBox, const string& svgPath)
{
if (!node->node.image.href) return nullptr;
if (!node->node.image.href || !strlen(node->node.image.href)) return nullptr;
auto picture = Picture::gen();
TaskScheduler::async(false); //force to load a picture on the same thread