$OpenBSD: patch-taglib_mp4_mp4file_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/mp4/mp4file.cpp.orig	Thu Sep  6 20:03:15 2012
+++ taglib/mp4/mp4file.cpp	Sun Jan 27 19:52:41 2013
@@ -67,14 +67,16 @@ MP4::File::File(FileName file, bool readProperties, Au
     : TagLib::File(file)
 {
   d = new FilePrivate;
-  read(readProperties, audioPropertiesStyle);
+  if(isOpen())
+	read(readProperties, audioPropertiesStyle);
 }
 
 MP4::File::File(IOStream *stream, bool readProperties, AudioProperties::ReadStyle audioPropertiesStyle)
     : TagLib::File(stream)
 {
   d = new FilePrivate;
-  read(readProperties, audioPropertiesStyle);
+  if(isOpen())
+	read(readProperties, audioPropertiesStyle);
 }
 
 MP4::File::~File()
