Commit af123cc2 authored by Thomas Guillem's avatar Thomas Guillem

input: hold renderer_item when passing control

This fix an invalid-read if more than one renderer items are passed in a row.
parent 9a647ec1
......@@ -27,6 +27,7 @@
#include <vlc_common.h>
#include <vlc_memstream.h>
#include <vlc_renderer_discovery.h>
#include <stdio.h>
#include <stdlib.h>
......@@ -576,7 +577,7 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
case INPUT_SET_RENDERER:
{
vlc_renderer_item_t* p_item = va_arg( args, vlc_renderer_item_t* );
val.p_address = p_item;
val.p_address = p_item ? vlc_renderer_item_hold( p_item ) : NULL;
input_ControlPush( p_input, INPUT_CONTROL_SET_RENDERER, &val );
return VLC_SUCCESS;
}
......
......@@ -1711,6 +1711,10 @@ static void ControlRelease( int i_type, vlc_value_t val )
case INPUT_CONTROL_UPDATE_VIEWPOINT:
free( val.p_address );
break;
case INPUT_CONTROL_SET_RENDERER:
if( val.p_address )
vlc_renderer_item_release( val.p_address );
break;
default:
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment