X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/903506828b7d042350eae97b5014a63ffca17ef5..1d7609197ed33bc76c8212705f305fe7cc33d62f:/src/common/imagtiff.cpp diff --git a/src/common/imagtiff.cpp b/src/common/imagtiff.cpp index 0c741c92c1..16c952d297 100644 --- a/src/common/imagtiff.cpp +++ b/src/common/imagtiff.cpp @@ -370,11 +370,11 @@ bool wxTIFFHandler::DoCanRead( wxInputStream& stream ) { unsigned char hdr[2]; - stream.Read(&hdr, 2); - stream.SeekI(-2, wxFromCurrent); + if ( !stream.Read(&hdr, WXSIZEOF(hdr)) ) + return FALSE; - return ((hdr[0] == 0x49 && hdr[1] == 0x49) || - (hdr[0] == 0x4D && hdr[1] == 0x4D)); + return (hdr[0] == 'I' && hdr[1] == 'I') || + (hdr[0] == 'M' && hdr[1] == 'M'); }