$OpenBSD: patch-taglib_asf_asffile_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/asf/asffile.cpp.orig	Thu Sep  6 20:03:15 2012
+++ taglib/asf/asffile.cpp	Sun Jan 27 19:52:41 2013
@@ -372,14 +372,16 @@ ASF::File::File(FileName file, bool readProperties, Pr
   : TagLib::File(file)
 {
   d = new FilePrivate;
-  read(readProperties, propertiesStyle);
+  if(isOpen())
+	read(readProperties, propertiesStyle);
 }
 
 ASF::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle propertiesStyle)
   : TagLib::File(stream)
 {
   d = new FilePrivate;
-  read(readProperties, propertiesStyle);
+  if(isOpen())
+	read(readProperties, propertiesStyle);
 }
 
 ASF::File::~File()
