[vlc-devel] [PATCH 16/18] gui/qt: fix #17184 (missing entries in context-menu)

Filip Roséen filip at videolabs.io
Wed Jul 20 12:38:00 CEST 2016


On 16/07/20 11:25, Francois Cartegnie wrote:

>      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.

To aid people who might be reviewing the patches, and this one in
particular, what follows is a conversation between me and Francois in
`freenode/#videolan` since I forgot to address the above in my latest
reply:

    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

There might of course be other issues, so please speak up if you find something
- think about the hippo!

Latest version:

	- https://mailman.videolan.org/pipermail/vlc-devel/2016-July/108660.html

	
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20160720/d78746b8/attachment.html>


More information about the vlc-devel mailing list