]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/imagtga.cpp
implement new wxBG_STYLE_XXX semantics for wxMSW too
[wxWidgets.git] / src / common / imagtga.cpp
index fc7373822bb0090ac06b3751027ebeb3d70538d2..d98ff01800d68f6438c64b9d0df388f9e94c69c3 100644 (file)
@@ -211,7 +211,8 @@ int ReadTGA(wxImage* image, wxInputStream& stream)
     }
 
     // Seek from the offset we got from the TGA header.
-    stream.SeekI(offset, wxFromStart);
+    if (stream.SeekI(offset, wxFromStart) == wxInvalidOffset)
+        return wxTGA_INVFORMAT;
 
     // Load a palette if we have one.
     if (colorType == wxTGA_MAPPED)
@@ -740,7 +741,7 @@ bool wxTGAHandler::DoCanRead(wxInputStream& stream)
 {
     // read the fixed-size TGA headers
     unsigned char hdr[HDR_SIZE];
-    stream.Read(hdr, HDR_SIZE);
+    stream.Read(hdr, HDR_SIZE);     // it's ok to modify the stream position here
 
     // Check wether we can read the file or not.