Merge pull request #91590 from timothyqiu/dupe

Fix crash when executing `Image.save_jpg_to_buffer`
This commit is contained in:
Rémi Verschelde 2024-07-05 15:07:22 +02:00
commit 4f953cc8ab
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -162,7 +162,7 @@ static Error _jpgd_save_to_output_stream(jpge::output_stream *p_output_stream, c
ERR_FAIL_COND_V_MSG(error != OK, error, "Couldn't decompress image.");
}
if (image->get_format() != Image::FORMAT_RGB8) {
image = p_img->duplicate();
image = image->duplicate();
image->convert(Image::FORMAT_RGB8);
}