зеркало из https://github.com/mozilla/pjs.git
Bug 642902 - If a profile's invalid, we leak it. Don't. r=jrmuizel
This commit is contained in:
Родитель
c1d15cca8e
Коммит
8ff517c46c
|
@ -84,6 +84,20 @@ static PRLogModuleInfo *gJPEGDecoderAccountingLog = PR_NewLogModule("JPEGDecoder
|
|||
#define gJPEGDecoderAccountingLog
|
||||
#endif
|
||||
|
||||
static qcms_profile*
|
||||
GetICCProfile(struct jpeg_decompress_struct &info)
|
||||
{
|
||||
JOCTET* profilebuf;
|
||||
PRUint32 profileLength;
|
||||
qcms_profile* profile = nsnull;
|
||||
|
||||
if (read_icc_profile(&info, &profilebuf, &profileLength)) {
|
||||
profile = qcms_profile_from_memory(profile, profileLength);
|
||||
free(profilebuf);
|
||||
}
|
||||
|
||||
return profile;
|
||||
}
|
||||
|
||||
METHODDEF(void) init_source (j_decompress_ptr jd);
|
||||
METHODDEF(boolean) fill_input_buffer (j_decompress_ptr jd);
|
||||
|
@ -248,14 +262,8 @@ nsJPEGDecoder::WriteInternal(const char *aBuffer, PRUint32 aCount)
|
|||
return;
|
||||
|
||||
/* We're doing a full decode. */
|
||||
JOCTET *profile;
|
||||
PRUint32 profileLength;
|
||||
|
||||
if ((mCMSMode != eCMSMode_Off) &&
|
||||
read_icc_profile(&mInfo, &profile, &profileLength) &&
|
||||
(mInProfile = qcms_profile_from_memory(profile, profileLength)) != NULL) {
|
||||
free(profile);
|
||||
|
||||
if (mCMSMode != eCMSMode_Off &&
|
||||
(mInProfile = GetICCProfile(mInfo)) != nsnull) {
|
||||
PRUint32 profileSpace = qcms_profile_get_color_space(mInProfile);
|
||||
PRBool mismatch = PR_FALSE;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче