Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I examined TagLib's code briefly.</p> <p>I know nothing about it and never used it, but the code looks buggy to me. Here's why -</p> <p>In MPEG::File::read(), we are looking for a tag - <code>d->ID3v2Location = findID3v2();</code>. If it doesn't exist, it isn't added to the tags vector. This is the check - <code>if(d->ID3v2Location >= 0)</code>.</p> <p>However, at the end of the function, just before returning, we have -</p> <pre><code>// Make sure that we have our default tag types available. ID3v2Tag(true); ID3v1Tag(true); </code></pre> <p>Now, <code>Id3v2Tag(create)</code> with a true parameter, actually calls <code>return d->tag.access(ID3v2Index, create);</code>. The access() function is -</p> <pre><code>template &lt;class T&gt; T *access(int index, bool create) { if(!create || tag(index)) return static_cast&lt;T *&gt;(tag(index)); set(index, new T); return static_cast&lt;T *&gt;(tag(index)); } </code></pre> <p>So when <code>create</code> is true, we are creating a brand new, empty tag and placing it in the vector (using the <code>set()</code> function).</p> <p>This means that no matter whether the file contains the tags or not, they are added to the vector. This isn't the documented behavior. Looks like a bug.</p> <p>I don't know why these two lines are needed there - looking at the history of this file might hint as to why they were added, but I didn't do that.</p> <p>Anyway, I want to stress that I never actually executed this code. This is based on purely statically reading only very small parts, without being aware of large scale issues.</p> <p>I think that opening a bug report can't hurt.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload