diff options
-rw-r--r-- | src/gui/image/qxpmhandler.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/image/qxpmhandler.cpp b/src/gui/image/qxpmhandler.cpp index 417dab7ce3..14823b457e 100644 --- a/src/gui/image/qxpmhandler.cpp +++ b/src/gui/image/qxpmhandler.cpp @@ -973,7 +973,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; @@ -991,7 +991,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; |