diff --git a/src/gui/image/qppmhandler.cpp b/src/gui/image/qppmhandler.cpp index 6f6469042b..bfde0aa76e 100644 --- a/src/gui/image/qppmhandler.cpp +++ b/src/gui/image/qppmhandler.cpp @@ -258,7 +258,7 @@ static bool read_pbm_body(QIODevice *device, char type, int w, int h, int mcc, Q } } else { while (n--) { - *p++ = read_pbm_int(device) * 255 / mcc; + *p++ = (read_pbm_int(device) & 0xffff) * 255 / mcc; } } } else { // 32 bits