TagLib 1.5 segfaults on one file

Vidar Wahlberg canidae at exent.net
Sat Jan 10 23:58:07 CET 2009


On Sat, Jan 10, 2009 at 11:23:51PM +0100, Scott Wheeler wrote:
> Here's the diff I checked in -- this should do the trick, no?
> 
> --- apeitem.cpp	(revision 892976)
> +++ apeitem.cpp	(working copy)
> @@ -164,7 +164,7 @@
>       case Binary:
>         if(d->text.isEmpty())
             ^^^^^^^^^^^^^^^^^
>           return true;
> -      if(d->text.size() == 1 && d->text.front().isEmpty())
> +      if(d->text.isEmpty() || (d->text.size() == 1 && d->text.front().isEmpty()))
            ^^^^^^^^^^^^^^^^^
>           return true;
>         return false;
>       case Locator:

I don't think this will make any difference, as this will as far as I
can tell only check twice if d->text is empty (and in both cases return
"true").
However, "if(d->type == Text)" instead of "if(d->type != Item::Binary)"
on line 209 in apeitem.cpp prevents it from segfaulting as the type
apparently is neither "Text" nor "Item::Binary". I don't know if you're
guaranteed that "d->text.begin()" never is "d->text.end()" if the type
is "Text", though. If this is guaranteed, then the check I added is not
necessary.

> You can also just build TagLib with autotools.  I do.  Then just doing  
> "make" in there does the trick.  If you're unfamiliar with KDE's old  
> autotools setup, you generate the configure file with "make -f  
> Makefile.cvs".

This did the trick, thanks :)


-- 
Regards,
Vidar Wahlberg


More information about the taglib-devel mailing list