fixed: std::string::find* uses string::npos if char isn't found.
authorwsoltys <wiso@no.way>
Wed, 30 Oct 2013 18:12:46 +0000 (19:12 +0100)
committerwsoltys <wiso@no.way>
Wed, 30 Oct 2013 18:12:46 +0000 (19:12 +0100)
xbmc/guilib/cximage.cpp

index ef12c33..0c79281 100644 (file)
@@ -46,8 +46,8 @@ bool CXImage::LoadImageFromMemory(unsigned char* buffer, unsigned int bufSize, u
   memset(&m_image, 0, sizeof(m_image));
 
   std::string strExt = m_strMimeType;
-  int nPos = strExt.find('/');
-  if (nPos > -1)
+  int nPos = strExt.find_first_of('/');
+  if (nPos != std::string::npos)
     strExt.erase(0, nPos + 1);
 
   if(!m_dll.LoadImageFromMemory(buffer, bufSize, strExt.c_str(), width, height, &m_image))