This commit is contained in:
2018-02-10 18:59:45 +01:00
16 changed files with 260 additions and 78 deletions

View File

@@ -1400,8 +1400,11 @@ void ui::Canvas::project_open_thread(std::string file_path)
fread(compressed.data(), 1, data_size, fp);
int imgw, imgh, imgc;
uint8_t* rgba = stbi_load_from_memory(compressed.data(), data_size, &imgw, &imgh, &imgc, 4);
std::copy(rgba, rgba + (imgw*imgh * 4), snap.image[plane_index].get());
delete rgba;
if (rgba)
{
std::copy(rgba, rgba + (imgw*imgh * 4), snap.image[plane_index].get());
delete rgba;
}
}
progress++;