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