Fix LTO and _FORTIFY_SOURCE=2 warnings (fixes #5965)

Tested with GCC 9 and 10 on AMD64.
This commit is contained in:
Flössie 2020-10-26 11:25:47 +01:00
parent 0bca993c73
commit 75f44d3f2b
3 changed files with 7 additions and 7 deletions

View File

@ -1399,7 +1399,7 @@ void CLASS nikon_load_raw()
void CLASS nikon_yuv_load_raw()
{
int row, col, yuv[4], rgb[3], b, c;
int row, col, yuv[4] = {}, rgb[3], b, c;
UINT64 bitbuf=0;
for (row=0; row < raw_height; row++)
@ -5620,7 +5620,7 @@ nf: order = 0x4949;
if (tag == 2 && strstr(make,"NIKON") && !iso_speed)
iso_speed = (get2(),get2());
if ((tag == 0x25 || tag == 0x28) && strstr(make,"NIKON") && !iso_speed) { // Nikon ISOInfo Tags/ISO & ISO2
uchar iso[1];
uchar iso[1] = {};
fread (iso, 1, 1, ifp);
iso_speed = 100 * pow(2,(float)iso[0]/12.0-5);
}

View File

@ -279,7 +279,7 @@ void RawImageSource::getAutoMatchedToneCurve(const ColorManagementParams &cp, st
{
RawMetaDataLocation rml;
eSensorType sensor_type;
int w, h;
int w = 0, h = 0;
std::unique_ptr<Thumbnail> thumb(Thumbnail::loadQuickFromRaw(getFileName(), rml, sensor_type, w, h, 1, false, true, true));
if (!thumb) {
if (settings->verbose) {

View File

@ -107,13 +107,13 @@ inline int getc (IMFILE* f)
return fgetc(f);
}
inline int fread (void* dst, int es, int count, IMFILE* f)
inline int fread (void* dst, size_t es, size_t count, IMFILE* f)
{
int s = es * count;
int avail = f->size - f->pos;
size_t s = es * count;
size_t avail = static_cast<size_t>(f->size) - static_cast<size_t>(f->pos);
if (s <= avail) {
if (static_cast<ssize_t>(s) <= static_cast<ssize_t>(avail)) {
memcpy (dst, f->data + f->pos, s);
f->pos += s;