Segfault when opening a folder which contains a 13229 x 57812 jpeg, fixes #3599

This commit is contained in:
heckflosse
2017-01-07 23:02:30 +01:00
parent a61db56826
commit 2f1da199bd
2 changed files with 2 additions and 2 deletions

View File

@@ -1291,7 +1291,7 @@ public:
b.height_ = height; b.height_ = height;
#endif #endif
abData.resize(width * height * 3); abData.resize(width * height * 3u);
if (!abData.isEmpty()) { if (!abData.isEmpty()) {
data = abData.data; data = abData.data;

View File

@@ -67,7 +67,7 @@ void Image8::setScanline (int row, unsigned char* buffer, int bps, float *minVal
switch (sampleFormat) { switch (sampleFormat) {
case (IIOSF_UNSIGNED_CHAR): case (IIOSF_UNSIGNED_CHAR):
memcpy (data + row * width * 3, buffer, width * 3); memcpy (data + row * width * 3u, buffer, width * 3);
break; break;
case (IIOSF_UNSIGNED_SHORT): { case (IIOSF_UNSIGNED_SHORT): {