Prevent excessive seeks in xbm detection
authorHarald Fernengel <harald.fernengel@nokia.com>
Thu, 4 Nov 2010 12:49:43 +0000 (13:49 +0100)
committerHarald Fernengel <harald.fernengel@nokia.com>
Thu, 4 Nov 2010 12:49:43 +0000 (13:49 +0100)
commit018c0ebc7d7ffaa55bf5a80b2a8a0e3ee1ebcc7b
treeaea8ef0d8ce7f466d049bbec5059f65e853b29b4
parentadc6d4776e6570fa6e6d5d2e4e40fe7eab0ebb99
Prevent excessive seeks in xbm detection

When auto-detecting an image type, the xbm handler would read
the entire file just to figure out that it's not an xbm. This patch
limits the read to maximum 4k and also breaks if line length >= 299.

Task-number: QT-4021
Reviewed-by: Robert Griebl
src/gui/image/qxbmhandler.cpp