xpm handler: fix read error caused by off-by-one in overflow check
The recently introduced overflow check for 8 bit images was too aggressive, causing the last pixel on each line to be rejected. As a driveby, add the same (fixed) overflow check also for 32bit images. Pick-to: 5.15 5.12 Fixes: QTBUG-86691 Change-Id: I62e4d5884e314f1171cb5a3e2c48657ce7259676 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>bb10
parent
679ec56d95
commit
6f2c7469f8
|
|
@ -976,7 +976,7 @@ static bool read_xpm_body(
|
|||
} else {
|
||||
char b[16];
|
||||
b[cpp] = '\0';
|
||||
for (x=0; x<w && d+cpp<end; x++) {
|
||||
for (x = 0; x < w && d + cpp <= end; x++) {
|
||||
memcpy(b, (char *)d, cpp);
|
||||
*p++ = (uchar)colorMap[xpmHash(b)];
|
||||
d += cpp;
|
||||
|
|
@ -994,7 +994,7 @@ static bool read_xpm_body(
|
|||
int x;
|
||||
char b[16];
|
||||
b[cpp] = '\0';
|
||||
for (x=0; x<w && d<end; x++) {
|
||||
for (x = 0; x < w && d + cpp <= end; x++) {
|
||||
memcpy(b, (char *)d, cpp);
|
||||
*p++ = (QRgb)colorMap[xpmHash(b)];
|
||||
d += cpp;
|
||||
|
|
|
|||
Loading…
Reference in New Issue