ByteVector::data()

Jeff Mitchell kde-dev at emailgoeshere.com
Wed Sep 26 18:04:15 CEST 2007


On Monday 17 September 2007, Andreas Hartmetz wrote:
> Hi!
>
> Today I dug around in taglib becaues Amarok crashed a lot. Turned out
> to be an ancient taglib in /usr/local/lib...
> Anyway, I think that QByteVector::data() (both const and non-const)
> are extremely dangerous if size() == 0. Templated containers, for
> example, may implicitly create empty instances. What about an
> assert(size()) or returning a null pointer to make the error really
> obvious? Some callers may even understand what a null char* pointer
> means.

I don't follow...isEmpty and isNull both exist for QByteArray and 
TagLib::ByteVector.  If there's specific Amarok code that's problematic, 
please email me off-list.  If there specific TagLib code that's problematic, 
perhaps you could provide examples?

Thanks,
Jeff


More information about the taglib-devel mailing list