qt: Fix another media menu string deallocation crash
This commit is contained in:
@@ -336,17 +336,16 @@ MediaHistoryManager::removeMissingImages(device_index_list_t &device_history)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *p = checked_path.toUtf8().data();
|
|
||||||
char temp[MAX_IMAGE_PATH_LEN -1] = { 0 };
|
char temp[MAX_IMAGE_PATH_LEN -1] = { 0 };
|
||||||
|
|
||||||
if (path_abs(p)) {
|
if (path_abs(checked_path.toUtf8().data())) {
|
||||||
if (strlen(p) > (MAX_IMAGE_PATH_LEN - 1))
|
if (checked_path.length() > (MAX_IMAGE_PATH_LEN - 1))
|
||||||
fatal("removeMissingImages(): strlen(p) > 2047\n");
|
fatal("removeMissingImages(): checked_path.length() > 2047\n");
|
||||||
else
|
else
|
||||||
snprintf(temp, (MAX_IMAGE_PATH_LEN - 1), "%s", p);
|
snprintf(temp, (MAX_IMAGE_PATH_LEN - 1), "%s", checked_path.toUtf8().constData());
|
||||||
} else
|
} else
|
||||||
snprintf(temp, (MAX_IMAGE_PATH_LEN - 1), "%s%s%s", usr_path,
|
snprintf(temp, (MAX_IMAGE_PATH_LEN - 1), "%s%s%s", usr_path,
|
||||||
path_get_slash(usr_path), p);
|
path_get_slash(usr_path), checked_path.toUtf8().constData());
|
||||||
path_normalize(temp);
|
path_normalize(temp);
|
||||||
|
|
||||||
QString qstr = QString::fromUtf8(temp);
|
QString qstr = QString::fromUtf8(temp);
|
||||||
|
|||||||
Reference in New Issue
Block a user