]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't pass empty string to wxFileNameFSSpec or you get a crash
authorRyan Norton <wxprojects@comcast.net>
Wed, 9 Mar 2005 18:53:45 +0000 (18:53 +0000)
committerRyan Norton <wxprojects@comcast.net>
Wed, 9 Mar 2005 18:53:45 +0000 (18:53 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32698 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/mediactrl.cpp

index 5b6aef7f1f85f6ccd05a28e22c83be05083f751d..d41c30cf9b69d5341932fc2b50e78896d4894630 100644 (file)
@@ -298,6 +298,12 @@ bool wxQTMediaBackend::Load(const wxString& fileName)
     short movieResFile;
     FSSpec sfFile;
     
+    //FIXME:wxMacFilename2FSSpec crashes on empty string - 
+    //does it crash on other strings too and should this
+    //"fix" be put in the carbon wxSound?
+    if (fileName.empty())
+        return false;
+    
     wxMacFilename2FSSpec( fileName , &sfFile );
     
     if (OpenMovieFile (&sfFile, &movieResFile, fsRdPerm) != noErr)