diff options
author | Trond Kjernåsen <trond@trolltech.com> | 2010-01-26 09:55:31 (GMT) |
---|---|---|
committer | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2010-01-27 15:30:28 (GMT) |
commit | cb9ff7135854b16fdebb637b28284d1e1883044c (patch) | |
tree | beb56ff720e8a960e244abd103b21046cdb75efc /src | |
parent | 38b0bc95448f65404f56c6dfebc54dc5f33c11a4 (diff) | |
download | Qt-cb9ff7135854b16fdebb637b28284d1e1883044c.zip Qt-cb9ff7135854b16fdebb637b28284d1e1883044c.tar.gz Qt-cb9ff7135854b16fdebb637b28284d1e1883044c.tar.bz2 |
Fixed an infinite loop that could occur when reading invalid BMP images.
Task-number: QTBUG-7530
Reviewed-by: Kim
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/image/qbmphandler.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/image/qbmphandler.cpp b/src/gui/image/qbmphandler.cpp index 854be2e..42e19b8 100644 --- a/src/gui/image/qbmphandler.cpp +++ b/src/gui/image/qbmphandler.cpp @@ -144,7 +144,7 @@ static QDataStream &operator<<(QDataStream &s, const BMP_INFOHDR &bi) static int calc_shift(int mask) { int result = 0; - while (!(mask & 1)) { + while (mask && !(mask & 1)) { result++; mask >>= 1; } |