Prevent directory creation on bogus thumbnail downloads (#15634)
This commit is contained in:
parent
785ff20437
commit
5533f3881f
|
@ -243,6 +243,13 @@ void cb_http_task_download_pl_thumbnail(
|
|||
if (!data || !data->data || string_is_empty(transf->path))
|
||||
goto finish;
|
||||
|
||||
/* Skip if data can't be good */
|
||||
if (data->status != 200)
|
||||
{
|
||||
err = "File not found.";
|
||||
goto finish;
|
||||
}
|
||||
|
||||
/* Create output directory, if required */
|
||||
strlcpy(output_dir, transf->path, sizeof(output_dir));
|
||||
path_basedir_wrapper(output_dir);
|
||||
|
@ -253,13 +260,6 @@ void cb_http_task_download_pl_thumbnail(
|
|||
goto finish;
|
||||
}
|
||||
|
||||
/* Skip if data can't be good */
|
||||
if (data->status != 200)
|
||||
{
|
||||
err = "File not found.";
|
||||
goto finish;
|
||||
}
|
||||
|
||||
/* Write thumbnail file to disk */
|
||||
if (!filestream_write_file(transf->path, data->data, data->len))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue