Commit 46ad1506 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Fix memory leak in KisJPEGConverter

LibPNG allocates "profile_data" for us, therefore, we should free it

CCBUG:410864
parent e6e9fea5
......@@ -173,8 +173,9 @@ KisImportExportErrorCode KisJPEGConverter::decode(QIODevice *io)
jpeg_destroy_decompress(&cinfo);
return ImportExportCodes::FormatColorSpaceUnsupported;
}
uchar* profile_data;
uint profile_len;
uchar* profile_data = 0;
uint profile_len = 0;
const KoColorProfile* profile = 0;
QByteArray profile_rawdata;
if (read_icc_profile(&cinfo, &profile_data, &profile_len)) {
......@@ -190,6 +191,8 @@ KisImportExportErrorCode KisJPEGConverter::decode(QIODevice *io)
dbgFile << "the profile is not suitable for output and therefore cannot be used in krita, we need to convert the image to a standard profile"; // TODO: in ko2 popup a selection menu to inform the user
}
}
free(profile_data);
}
const QString colorSpaceId =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment