]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/imagjpeg.cpp
Allow building wxProtocol without wxUSE_SOCKETS
[wxWidgets.git] / src / common / imagjpeg.cpp
index 23c5e7aa366ea3c8b5f0e3df15c90b4834e6f772..c2525bae43fcf288e561e5f091b17f3e87aea94c 100644 (file)
@@ -378,9 +378,10 @@ bool wxJPEGHandler::DoCanRead( wxInputStream& stream )
 {
     unsigned char hdr[2];
 
-    stream.Read(hdr, 2);
-    stream.SeekI(-2, wxFromCurrent);
-    return (hdr[0] == 0xFF && hdr[1] == 0xD8);
+    if ( !stream.Read(hdr, WXSIZEOF(hdr)) )
+        return FALSE;
+
+    return hdr[0] == 0xFF && hdr[1] == 0xD8;
 }
 
 #endif   // wxUSE_STREAMS