We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6dde30e commit cf5e165Copy full SHA for cf5e165
src/util/bitmap.cc
@@ -604,8 +604,9 @@ bool Bitmap::ReadExifTag(const FREE_IMAGE_MDMODEL model,
604
605
void Bitmap::SetPtr(FIBITMAP* data) {
606
if (!IsPtrSupported(data)) {
607
- FreeImage_Unload(data);
608
- data = FreeImage_ConvertTo24Bits(data);
+ FIBITMAP* temp_data = data;
+ data = FreeImage_ConvertTo24Bits(temp_data);
609
+ FreeImage_Unload(temp_data);
610
}
611
612
data_ = FIBitmapPtr(data, &FreeImage_Unload);
0 commit comments