$OpenBSD: patch-taglib_s3m_s3mfile_cpp,v 1.1 2013/01/27 21:28:25 dcoppa Exp $

Check if file is open before attempting to read tags: fix a crash
in the file constructor if the file does not exist
(upstream git commit d15c8453ac75d9070008b9170ae114ea31a4b586)

--- taglib/s3m/s3mfile.cpp.orig	Thu Sep  6 20:03:15 2012
+++ taglib/s3m/s3mfile.cpp	Sun Jan 27 19:52:41 2013
@@ -47,7 +47,8 @@ S3M::File::File(FileName file, bool readProperties,
   Mod::FileBase(file),
   d(new FilePrivate(propertiesStyle))
 {
-  read(readProperties);
+	if(isOpen())
+		read(readProperties);
 }
 
 S3M::File::File(IOStream *stream, bool readProperties,
@@ -55,7 +56,8 @@ S3M::File::File(IOStream *stream, bool readProperties,
   Mod::FileBase(stream),
   d(new FilePrivate(propertiesStyle))
 {
-  read(readProperties);
+	if(isOpen())
+		read(readProperties);
 }
 
 S3M::File::~File()
