musikr: fix use-after-free in iostream shim
This commit is contained in:
parent
e22f811c81
commit
1dc33c1ae1
1 changed files with 6 additions and 2 deletions
|
@ -29,16 +29,20 @@ namespace taglib_shim
|
||||||
bool isOpen() const override;
|
bool isOpen() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
std::string _name;
|
||||||
RsIOStream *rust_stream;
|
RsIOStream *rust_stream;
|
||||||
};
|
};
|
||||||
|
|
||||||
WrappedRsIOStream::WrappedRsIOStream(RsIOStream *stream) : rust_stream(stream) {}
|
WrappedRsIOStream::WrappedRsIOStream(RsIOStream *stream) : rust_stream(stream)
|
||||||
|
{
|
||||||
|
_name = std::move(std::string(rust_stream->name()));
|
||||||
|
}
|
||||||
|
|
||||||
WrappedRsIOStream::~WrappedRsIOStream() = default;
|
WrappedRsIOStream::~WrappedRsIOStream() = default;
|
||||||
|
|
||||||
TagLib::FileName WrappedRsIOStream::name() const
|
TagLib::FileName WrappedRsIOStream::name() const
|
||||||
{
|
{
|
||||||
return rust::string(rust_stream->name()).c_str();
|
return _name.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
TagLib::ByteVector WrappedRsIOStream::readBlock(size_t length)
|
TagLib::ByteVector WrappedRsIOStream::readBlock(size_t length)
|
||||||
|
|
Loading…
Reference in a new issue