<p>On 16/07/20 11:25, Francois Cartegnie wrote:</p>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code> Le 20/07/2016 à 04:37, Filip Roséen a écrit :
 [ ... ]
 -    if( !index.isValid() )
 -        return false;
 -
 -    const PLItem *item = getItem( index );
 +    vlc_playlist_locker pl_lock ( THEPL );
 +        
 +    bool const b_readonly = THEPL->p_root->i_flags & PLAYLIST_RO_FLAG;
 +    AbstractPLItem * item = VLCModel::getItem( index );
 And then you introduce NULL deref in most cases.</code></pre>
</blockquote>
<p>To aid people who might be reviewing the patches, and this one in particular, what follows is a conversation between me and Francois in <code>freenode/#videolan</code> since I forgot to address the above in my latest reply:</p>
<pre><code>11:45:57  InTheWings$ VLCModel::getItem( index );
11:46:09  InTheWings$ returns NULL if index is not valid
11:46:13  InTheWings$ then you used item->
11:46:51  refp$ InTheWings: where do I do "item->" without making sure that item is 
                valid?
11:48:01  refp$ I, honestly, do not see a single case where this can happen.
11:48:33  InTheWings$ case ACTION_ADDTOPLAYLIST:
11:48:37  InTheWings$ case ACTION_REMOVE
11:48:50  InTheWings$ ok
11:48:53  InTheWings$ nvm</code></pre>
<p>There might of course be other issues, so please speak up if you find something - think about the hippo!</p>
<p>Latest version:</p>
<pre><code>- https://mailman.videolan.org/pipermail/vlc-devel/2016-July/108660.html</code></pre>