branch | RCL_3 |
changeset 8 | 3f74d0d4af4c |
parent 4 | 3b1da2848fc7 |
child 30 | 5dc02b23752f |
--- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp Mon Mar 15 12:43:09 2010 +0200 +++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp Thu Apr 08 14:19:33 2010 +0300 @@ -1188,7 +1188,11 @@ return false; } - return device->peek(2) == "\xFF\xD8"; + char buffer[2]; + if (device->peek(buffer, 2) != 2) + return false; + + return uchar(buffer[0]) == 0xff && uchar(buffer[1]) == 0xd8; } bool QJpegHandler::read(QImage *image)