From 35cdcd3b958460dfe6da40ff68f673d1fdca1aaf Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu Date: Sat, 22 Jun 2013 16:12:57 +0900 Subject: [PATCH 1/2] Added a missing check if an Opus file is open --- taglib/ogg/opus/opusfile.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/taglib/ogg/opus/opusfile.cpp b/taglib/ogg/opus/opusfile.cpp index 8d3af7af..91ec5a09 100644 --- a/taglib/ogg/opus/opusfile.cpp +++ b/taglib/ogg/opus/opusfile.cpp @@ -59,18 +59,20 @@ public: // public members //////////////////////////////////////////////////////////////////////////////// -Opus::File::File(FileName file, bool readProperties, - Properties::ReadStyle propertiesStyle) : Ogg::File(file) +Opus::File::File(FileName file, bool readProperties, Properties::ReadStyle propertiesStyle) + : Ogg::File(file) + , d(new FilePrivate()) { - d = new FilePrivate; - read(readProperties, propertiesStyle); + if(isOpen()) + read(readProperties, propertiesStyle); } -Opus::File::File(IOStream *stream, bool readProperties, - Properties::ReadStyle propertiesStyle) : Ogg::File(stream) +Opus::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle propertiesStyle) + : Ogg::File(stream) + , d(new FilePrivate()) { - d = new FilePrivate; - read(readProperties, propertiesStyle); + if(isOpen()) + read(readProperties, propertiesStyle); } Opus::File::~File() From ab417fd9e3a481ad76caaa1d5205af928ce73772 Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu Date: Sat, 22 Jun 2013 18:06:40 +0900 Subject: [PATCH 2/2] Changed the style to follow TagLib's one --- taglib/ogg/opus/opusfile.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/taglib/ogg/opus/opusfile.cpp b/taglib/ogg/opus/opusfile.cpp index 91ec5a09..cb81a32b 100644 --- a/taglib/ogg/opus/opusfile.cpp +++ b/taglib/ogg/opus/opusfile.cpp @@ -59,17 +59,17 @@ public: // public members //////////////////////////////////////////////////////////////////////////////// -Opus::File::File(FileName file, bool readProperties, Properties::ReadStyle propertiesStyle) - : Ogg::File(file) - , d(new FilePrivate()) +Opus::File::File(FileName file, bool readProperties, Properties::ReadStyle propertiesStyle) : + Ogg::File(file), + d(new FilePrivate()) { if(isOpen()) read(readProperties, propertiesStyle); } -Opus::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle propertiesStyle) - : Ogg::File(stream) - , d(new FilePrivate()) +Opus::File::File(IOStream *stream, bool readProperties, Properties::ReadStyle propertiesStyle) : + Ogg::File(stream), + d(new FilePrivate()) { if(isOpen()) read(readProperties, propertiesStyle);