- while( ( i_read = stream_Read( p_stream, p_buffer, 1 << 10 ) ) &&
- !intf_ProgressIsCancelled( p_udt, i_progress ) )
+ vlc_object_lock( p_udt );
+ while( vlc_object_alive( p_udt ) &&
+ ( i_read = stream_Read( p_stream, p_buffer, 1 << 10 ) ) &&
+ !intf_ProgressIsCancelled( p_udt, i_progress ) )