Merge remote-tracking branch 'origin/IccTiffCrash' into gtk3

This commit is contained in:
Hombre 2015-08-16 00:17:37 +02:00
commit 7a2e0c7b96

View File

@ -1196,7 +1196,11 @@ int ImageIO::saveTIFF (Glib::ustring fname, int bps, bool uncompressed)
}
// buffer for the exif and iptc
unsigned char* buffer = new unsigned char[165535]; //TODO: Is it really 165535... or 65535 ?
int bufferSize = 165535; //TODO: Is it really 165535... or 65535 ?
if(profileData)
bufferSize += profileLength;
unsigned char* buffer = new unsigned char[bufferSize];
unsigned char* iptcdata = NULL;
unsigned int iptclen = 0;
@ -1213,7 +1217,7 @@ int ImageIO::saveTIFF (Glib::ustring fname, int bps, bool uncompressed)
// The maximum lenght is strangely not the same than for the JPEG file...
// Which maximum length is the good one ?
if (size > 0 && size < 165530) {
if (size > 0 && size < bufferSize) {
fwrite (buffer, size, 1, file);
}