Skip to content

Commit

Permalink
Merge pull request #91590 from timothyqiu/dupe
Browse files Browse the repository at this point in the history
Fix crash when executing `Image.save_jpg_to_buffer`
  • Loading branch information
akien-mga committed Jul 5, 2024
2 parents ce16818 + 7355e67 commit 4f953cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/jpg/image_loader_jpegd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 4f953cc

Please sign in to comment.