Commit 4cbad9d6 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

backports: Fixes mostly from gbazin

 - [16941] (partially) fix bug in variable value inheritence
 - [16942] (edited) border options of mosaic filter
 - [16958] fix raw m4v and h264 detection
 - [16971] avoid using the C++ STL. This gets rid of weird crashes in the vector template
 - [16974] fixed invalid memory access in stream_ReadLine()
 - [16996] fixed a bunch of memleaks
 - [16997] fixed a memleak in asf
 - [16998] fixed memleaks in slave/sub handling
 - [17000] Add RV20 fourcc
 - [17001] and [17007] fix errors in [16996]
 - [17008] memleak in XML xtag parser
 - [17019] memset fix in Ty module
parent 1efd95b7
......@@ -245,7 +245,9 @@ static inline void es_format_Copy( es_format_t *dst, es_format_t *src )
}
dst->i_extra_languages = src->i_extra_languages;
dst->p_extra_languages = (extra_languages_t*) malloc( dst->i_extra_languages * sizeof(*dst->p_extra_languages ) );
if( dst->i_extra_languages )
dst->p_extra_languages = (extra_languages_t*)
malloc(dst->i_extra_languages * sizeof(*dst->p_extra_languages ));
for( i = 0; i < dst->i_extra_languages; i++ ) {
if( src->p_extra_languages[i].psz_language )
dst->p_extra_languages[i].psz_language = strdup(src->p_extra_languages[i].psz_language);
......
......@@ -404,6 +404,7 @@ static void Close( vlc_object_t *p_this )
decoder_sys_t *p_sys = p_dec->p_sys;
faacDecClose( p_sys->hfaad );
if( p_sys->p_buffer ) free( p_sys->p_buffer );
free( p_sys );
}
......
......@@ -847,6 +847,10 @@ static struct
VIDEO_ES, "Real Video 10" },
{ VLC_FOURCC('R','V','1','3'), CODEC_ID_RV10,
VIDEO_ES, "Real Video 13" },
#if LIBAVCODEC_BUILD >= ((51<<16)+(15<<8)+1)
{ VLC_FOURCC('R','V','2','0'), CODEC_ID_RV20,
VIDEO_ES, "Real Video 20" },
#endif
#if LIBAVCODEC_BUILD >= 4684
/* Apple Video */
......
......@@ -1156,6 +1156,8 @@ static void ASF_FreeObject_extended_content_description( asf_object_t *p_obj)
FREE( p_ec->ppsz_name[i] );
FREE( p_ec->ppsz_value[i] );
}
FREE( p_ec->ppsz_name );
FREE( p_ec->ppsz_value );
}
......
......@@ -429,12 +429,15 @@ static int AVI_ChunkRead_strd( stream_t *s, avi_chunk_t *p_chk )
{
AVI_READCHUNK_ENTER;
p_chk->strd.p_data = malloc( p_chk->common.i_chunk_size );
memcpy( p_chk->strd.p_data,
p_buff + 8,
p_chk->common.i_chunk_size );
memcpy( p_chk->strd.p_data, p_buff + 8, p_chk->common.i_chunk_size );
AVI_READCHUNK_EXIT( VLC_SUCCESS );
}
static void AVI_ChunkFree_strd( avi_chunk_t *p_chk )
{
if( p_chk->strd.p_data ) free( p_chk->strd.p_data );
}
static int AVI_ChunkRead_idx1( stream_t *s, avi_chunk_t *p_chk )
{
unsigned int i_count, i_index;
......@@ -654,7 +657,7 @@ static struct
{ AVIFOURCC_avih, AVI_ChunkRead_avih, AVI_ChunkFree_nothing },
{ AVIFOURCC_strh, AVI_ChunkRead_strh, AVI_ChunkFree_nothing },
{ AVIFOURCC_strf, AVI_ChunkRead_strf, AVI_ChunkFree_strf },
{ AVIFOURCC_strd, AVI_ChunkRead_strd, AVI_ChunkFree_nothing },
{ AVIFOURCC_strd, AVI_ChunkRead_strd, AVI_ChunkFree_strd },
{ AVIFOURCC_idx1, AVI_ChunkRead_idx1, AVI_ChunkFree_idx1 },
{ AVIFOURCC_indx, AVI_ChunkRead_indx, AVI_ChunkFree_indx },
{ AVIFOURCC_JUNK, AVI_ChunkRead_nothing, AVI_ChunkFree_nothing },
......
......@@ -69,7 +69,6 @@ static int Open( vlc_object_t * p_this )
{
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys;
uint8_t *p_peek;
if( stream_Peek( p_demux->s, &p_peek, 4 ) < 4 ) return VLC_EGENERIC;
......
......@@ -304,7 +304,9 @@ static int Demux( demux_t *p_demux )
{
p_sys->b_start = VLC_FALSE;
p_block_in = p_sys->p_block_in;
p_sys->p_block_in = NULL;
p_block_out = p_sys->p_block_out;
p_sys->p_block_out = NULL;
}
else
{
......@@ -355,6 +357,7 @@ static void Close( vlc_object_t * p_this )
demux_sys_t *p_sys = p_demux->p_sys;
if( p_sys->meta ) vlc_meta_Delete( p_sys->meta );
if( p_sys->p_block_out ) block_Release( p_sys->p_block_out );
if( p_sys->p_packetizer && p_sys->p_packetizer->p_module )
module_Unneed( p_sys->p_packetizer, p_sys->p_packetizer->p_module );
......
......@@ -308,7 +308,7 @@ static int check_sync_pes( demux_t *p_demux, block_t *p_block,
if( offset < 0 )
{
/* no header found, fake some 00's (this works, believe me) */
memset( p_sys->pes_buffer, 4, 0 );
memset( p_sys->pes_buffer, 0, 4 );
p_sys->i_pes_buf_cnt = 4;
if( rec_len > 4 )
msg_Err( p_demux, "PES header not found in record of %d bytes!",
......
......@@ -51,9 +51,6 @@
#include <wx/statline.h>
#include <wx/tokenzr.h>
#include <vector>
#ifndef wxRB_SINGLE
# define wxRB_SINGLE 0
#endif
......
......@@ -27,8 +27,10 @@
#include "wxwidgets.hpp"
#include "interface.hpp"
#include <vector>
using namespace std;
#include <wx/dynarray.h>
WX_DEFINE_ARRAY(int, ArrayOfInts);
WX_DEFINE_ARRAY_PTR(const char *, ArrayOfStrings);
class wxMenuItemExt: public wxMenuItem
{
......@@ -53,7 +55,7 @@ public:
Menu( intf_thread_t *p_intf, int i_start_id );
virtual ~Menu();
void Populate( vector<const char *> &, vector<int> &);
void Populate( ArrayOfStrings &, ArrayOfInts &);
void Clear();
private:
......@@ -142,11 +144,11 @@ wxMenu *MiscMenu( intf_thread_t *p_intf )
/*****************************************************************************
* Builders for the dynamic menus
*****************************************************************************/
#define PUSH_VAR( var ) rs_varnames.push_back( var ); \
ri_objects.push_back( p_object->i_object_id )
#define PUSH_VAR( var ) rs_varnames.Add( var ); \
ri_objects.Add( p_object->i_object_id )
int InputAutoMenuBuilder( vlc_object_t *p_object, vector<int> &ri_objects,
vector<const char *> &rs_varnames )
int InputAutoMenuBuilder( vlc_object_t *p_object, ArrayOfInts &ri_objects,
ArrayOfStrings &rs_varnames )
{
PUSH_VAR( "bookmark");
PUSH_VAR( "title" );
......@@ -157,8 +159,8 @@ int InputAutoMenuBuilder( vlc_object_t *p_object, vector<int> &ri_objects,
return VLC_SUCCESS;
}
int VideoAutoMenuBuilder( vlc_object_t *p_object, vector<int> &ri_objects,
vector<const char *> &rs_varnames )
int VideoAutoMenuBuilder( vlc_object_t *p_object, ArrayOfInts &ri_objects,
ArrayOfStrings &rs_varnames )
{
PUSH_VAR( "fullscreen" );
PUSH_VAR( "zoom" );
......@@ -181,8 +183,8 @@ int VideoAutoMenuBuilder( vlc_object_t *p_object, vector<int> &ri_objects,
return VLC_SUCCESS;
}
int AudioAutoMenuBuilder( vlc_object_t *p_object, vector<int> &ri_objects,
vector<const char *> &rs_varnames )
int AudioAutoMenuBuilder( vlc_object_t *p_object, ArrayOfInts &ri_objects,
ArrayOfStrings &rs_varnames )
{
PUSH_VAR( "audio-device" );
PUSH_VAR( "audio-channels" );
......@@ -191,8 +193,8 @@ int AudioAutoMenuBuilder( vlc_object_t *p_object, vector<int> &ri_objects,
return VLC_SUCCESS;
}
int IntfAutoMenuBuilder( intf_thread_t *p_intf, vector<int> &ri_objects,
vector<const char *> &rs_varnames, bool is_popup)
int IntfAutoMenuBuilder( intf_thread_t *p_intf, ArrayOfInts &ri_objects,
ArrayOfStrings &rs_varnames, bool is_popup)
{
/* vlc_object_find is needed because of the dialogs provider case */
vlc_object_t *p_object;
......@@ -221,18 +223,18 @@ int IntfAutoMenuBuilder( intf_thread_t *p_intf, vector<int> &ri_objects,
/*****************************************************************************
* Popup menus
*****************************************************************************/
#define PUSH_VAR( var ) as_varnames.push_back( var ); \
ai_objects.push_back( p_object->i_object_id )
#define PUSH_VAR( var ) as_varnames.Add( var ); \
ai_objects.Add( p_object->i_object_id )
#define PUSH_SEPARATOR if( ai_objects.size() != i_last_separator ) { \
ai_objects.push_back( 0 ); \
as_varnames.push_back( "" ); \
i_last_separator = ai_objects.size(); }
#define PUSH_SEPARATOR if( ai_objects.GetCount() != i_last_separator ) { \
ai_objects.Add( 0 ); \
as_varnames.Add( "" ); \
i_last_separator = ai_objects.GetCount(); }
#define POPUP_BOILERPLATE \
unsigned int i_last_separator = 0; \
vector<int> ai_objects; \
vector<const char *> as_varnames; \
ArrayOfInts ai_objects; \
ArrayOfStrings as_varnames; \
playlist_t *p_playlist = (playlist_t *) vlc_object_find( p_intf, \
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );\
if( !p_playlist ) \
......@@ -288,10 +290,10 @@ void VideoPopupMenu( intf_thread_t *p_intf, wxWindow *p_parent,
if( p_input )
{
vlc_object_yield( p_input );
as_varnames.push_back( "video-es" );
ai_objects.push_back( p_input->i_object_id );
as_varnames.push_back( "spu-es" );
ai_objects.push_back( p_input->i_object_id );
as_varnames.Add( "video-es" );
ai_objects.Add( p_input->i_object_id );
as_varnames.Add( "spu-es" );
ai_objects.Add( p_input->i_object_id );
vlc_object_t *p_vout = (vlc_object_t *)vlc_object_find( p_input,
VLC_OBJECT_VOUT, FIND_CHILD );
if( p_vout )
......@@ -312,8 +314,8 @@ void AudioPopupMenu( intf_thread_t *p_intf, wxWindow *p_parent,
if( p_input )
{
vlc_object_yield( p_input );
as_varnames.push_back( "audio-es" );
ai_objects.push_back( p_input->i_object_id );
as_varnames.Add( "audio-es" );
ai_objects.Add( p_input->i_object_id );
vlc_object_t *p_aout = (vlc_object_t *)vlc_object_find( p_input,
VLC_OBJECT_AOUT, FIND_ANYWHERE );
if( p_aout )
......@@ -336,7 +338,7 @@ void MiscPopupMenu( intf_thread_t *p_intf, wxWindow *p_parent,
if( p_input )
{
vlc_object_yield( p_input );
as_varnames.push_back( "audio-es" );
as_varnames.Add( "audio-es" );
InputAutoMenuBuilder( VLC_OBJECT(p_input), ai_objects, as_varnames );
PUSH_SEPARATOR;
}
......@@ -367,10 +369,10 @@ void PopupMenu( intf_thread_t *p_intf, wxWindow *p_parent,
/* Video menu */
PUSH_SEPARATOR;
as_varnames.push_back( "video-es" );
ai_objects.push_back( p_input->i_object_id );
as_varnames.push_back( "spu-es" );
ai_objects.push_back( p_input->i_object_id );
as_varnames.Add( "video-es" );
ai_objects.Add( p_input->i_object_id );
as_varnames.Add( "spu-es" );
ai_objects.Add( p_input->i_object_id );
vlc_object_t *p_vout = (vlc_object_t *)vlc_object_find( p_input,
VLC_OBJECT_VOUT, FIND_CHILD );
if( p_vout )
......@@ -380,8 +382,8 @@ void PopupMenu( intf_thread_t *p_intf, wxWindow *p_parent,
}
/* Audio menu */
PUSH_SEPARATOR
as_varnames.push_back( "audio-es" );
ai_objects.push_back( p_input->i_object_id );
as_varnames.Add( "audio-es" );
ai_objects.Add( p_input->i_object_id );
vlc_object_t *p_aout = (vlc_object_t *)vlc_object_find( p_input,
VLC_OBJECT_AOUT, FIND_ANYWHERE );
if( p_aout )
......@@ -417,8 +419,8 @@ void PopupMenu( intf_thread_t *p_intf, wxWindow *p_parent,
wxMenu *AudioMenu( intf_thread_t *_p_intf, wxWindow *p_parent, wxMenu *p_menu )
{
vlc_object_t *p_object;
vector<int> ai_objects;
vector<const char *> as_varnames;
ArrayOfInts ai_objects;
ArrayOfStrings as_varnames;
p_object = (vlc_object_t *)vlc_object_find( _p_intf, VLC_OBJECT_INPUT,
FIND_ANYWHERE );
......@@ -451,8 +453,8 @@ wxMenu *AudioMenu( intf_thread_t *_p_intf, wxWindow *p_parent, wxMenu *p_menu )
wxMenu *VideoMenu( intf_thread_t *_p_intf, wxWindow *p_parent, wxMenu *p_menu )
{
vlc_object_t *p_object;
vector<int> ai_objects;
vector<const char *> as_varnames;
ArrayOfInts ai_objects;
ArrayOfStrings as_varnames;
p_object = (vlc_object_t *)vlc_object_find( _p_intf, VLC_OBJECT_INPUT,
FIND_ANYWHERE );
......@@ -485,8 +487,8 @@ wxMenu *VideoMenu( intf_thread_t *_p_intf, wxWindow *p_parent, wxMenu *p_menu )
wxMenu *NavigMenu( intf_thread_t *_p_intf, wxWindow *p_parent, wxMenu *p_menu )
{
vlc_object_t *p_object;
vector<int> ai_objects;
vector<const char *> as_varnames;
ArrayOfInts ai_objects;
ArrayOfStrings as_varnames;
p_object = (vlc_object_t *)vlc_object_find( _p_intf, VLC_OBJECT_INPUT,
FIND_ANYWHERE );
......@@ -514,8 +516,8 @@ wxMenu *SettingsMenu( intf_thread_t *_p_intf, wxWindow *p_parent,
wxMenu *p_menu )
{
vlc_object_t *p_object;
vector<int> ai_objects;
vector<const char *> as_varnames;
ArrayOfInts ai_objects;
ArrayOfStrings as_varnames;
p_object = (vlc_object_t *)vlc_object_find( _p_intf, VLC_OBJECT_INTF,
FIND_PARENT );
......@@ -555,8 +557,8 @@ Menu::~Menu()
/*****************************************************************************
* Public methods.
*****************************************************************************/
void Menu::Populate( vector<const char *> & ras_varnames,
vector<int> & rai_objects )
void Menu::Populate( ArrayOfStrings & ras_varnames,
ArrayOfInts & rai_objects )
{
vlc_object_t *p_object;
vlc_bool_t b_section_empty = VLC_FALSE;
......@@ -564,7 +566,7 @@ void Menu::Populate( vector<const char *> & ras_varnames,
i_item_id = i_start_id;
for( i = 0; i < (int)rai_objects.size() ; i++ )
for( i = 0; i < (int)rai_objects.GetCount() ; i++ )
{
if( !ras_varnames[i] || !*ras_varnames[i] )
{
......
......@@ -203,6 +203,7 @@ static xml_reader_t *ReaderCreate( xml_t *p_xml, stream_t *s )
return 0;
}
free( p_buffer );
p_reader = malloc( sizeof(xml_reader_t) );
p_reader->p_sys = malloc( sizeof(xml_reader_sys_t) );
p_reader->p_sys->p_root = p_root;
......
......@@ -72,7 +72,7 @@ struct filter_sys_t
int i_cols, i_rows; /* mosaic rows and cols */
int i_align; /* mosaic alignment in background video */
int i_xoffset, i_yoffset; /* top left corner offset */
int i_vborder, i_hborder; /* border width/height between miniatures */
int i_borderw, i_borderh; /* border width/height between miniatures */
int i_alpha; /* subfilter alpha blending */
vlc_bool_t b_bs; /* Bluescreen vars */
......@@ -100,12 +100,10 @@ struct filter_sys_t
#define XOFFSET_LONGTEXT N_("X Coordinate of the top-left corner of the mosaic.")
#define YOFFSET_TEXT N_("Top left corner Y coordinate")
#define YOFFSET_LONGTEXT N_("Y Coordinate of the top-left corner of the mosaic.")
#define VBORDER_TEXT N_("Vertical border width")
#define VBORDER_LONGTEXT N_( "Width in pixels of the border than can be "\
"drawn vertically around the mosaic." )
#define HBORDER_TEXT N_("Horizontal border width")
#define HBORDER_LONGTEXT N_( "Width in pixels of the border than can "\
"be drawn horizontally around the mosaic." )
#define BORDERW_TEXT N_("Border width")
#define BORDERW_LONGTEXT N_( "Width in pixels of the border between miniatures." )
#define BORDERH_TEXT N_("Border height")
#define BORDERH_LONGTEXT N_( "Height in pixels of the border between miniatures." )
#define ALIGN_TEXT N_("Mosaic alignment" )
#define ALIGN_LONGTEXT N_( \
......@@ -188,8 +186,10 @@ vlc_module_begin();
change_integer_list( pi_align_values, ppsz_align_descriptions, 0 );
add_integer( "mosaic-xoffset", 0, NULL, XOFFSET_TEXT, XOFFSET_LONGTEXT, VLC_TRUE );
add_integer( "mosaic-yoffset", 0, NULL, YOFFSET_TEXT, YOFFSET_LONGTEXT, VLC_TRUE );
add_integer( "mosaic-vborder", 0, NULL, VBORDER_TEXT, VBORDER_LONGTEXT, VLC_TRUE );
add_integer( "mosaic-hborder", 0, NULL, HBORDER_TEXT, HBORDER_LONGTEXT, VLC_TRUE );
add_integer( "mosaic-borderw", 0, NULL, BORDERW_TEXT, BORDERW_LONGTEXT, VLC_TRUE );
add_deprecated( "mosaic-vborder", VLC_FALSE );
add_integer( "mosaic-borderh", 0, NULL, BORDERH_TEXT, BORDERH_LONGTEXT, VLC_TRUE );
add_deprecated( "mosaic-hborder", VLC_FALSE );
add_integer( "mosaic-position", 0, NULL, POS_TEXT, POS_LONGTEXT, VLC_FALSE );
change_integer_list( pi_pos_values, ppsz_pos_descriptions, 0 );
......@@ -270,8 +270,8 @@ static int CreateFilter( vlc_object_t *p_this )
var_SetInteger( p_libvlc, "mosaic-align", p_sys->i_align );
var_AddCallback( p_libvlc, "mosaic-align", MosaicCallback, p_sys );
GET_VAR( vborder, 0, INT_MAX );
GET_VAR( hborder, 0, INT_MAX );
GET_VAR( borderw, 0, INT_MAX );
GET_VAR( borderh, 0, INT_MAX );
GET_VAR( rows, 1, INT_MAX );
GET_VAR( cols, 1, INT_MAX );
GET_VAR( alpha, 0, 255 );
......@@ -366,8 +366,8 @@ static void DestroyFilter( vlc_object_t *p_this )
var_Destroy( p_libvlc, "mosaic-width" );
var_Destroy( p_libvlc, "mosaic-xoffset" );
var_Destroy( p_libvlc, "mosaic-yoffset" );
var_Destroy( p_libvlc, "mosaic-vborder" );
var_Destroy( p_libvlc, "mosaic-hborder" );
var_Destroy( p_libvlc, "mosaic-borderw" );
var_Destroy( p_libvlc, "mosaic-borderh" );
var_Destroy( p_libvlc, "mosaic-position" );
var_Destroy( p_libvlc, "mosaic-rows" );
var_Destroy( p_libvlc, "mosaic-cols" );
......@@ -473,9 +473,9 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
}
col_inner_width = ( ( p_sys->i_width - ( p_sys->i_cols - 1 )
* p_sys->i_vborder ) / p_sys->i_cols );
* p_sys->i_borderw ) / p_sys->i_cols );
row_inner_height = ( ( p_sys->i_height - ( p_sys->i_rows - 1 )
* p_sys->i_hborder ) / p_sys->i_rows );
* p_sys->i_borderh ) / p_sys->i_rows );
i_real_index = 0;
......@@ -701,14 +701,14 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
whole rectangle area or it's larger than the rectangle */
p_region->i_x = p_sys->i_xoffset
+ i_col * ( p_sys->i_width / p_sys->i_cols )
+ ( i_col * p_sys->i_vborder ) / p_sys->i_cols;
+ ( i_col * p_sys->i_borderw ) / p_sys->i_cols;
}
else
{
/* center the video in the dedicated rectangle */
p_region->i_x = p_sys->i_xoffset
+ i_col * ( p_sys->i_width / p_sys->i_cols )
+ ( i_col * p_sys->i_vborder ) / p_sys->i_cols
+ ( i_col * p_sys->i_borderw ) / p_sys->i_cols
+ ( col_inner_width - fmt_out.i_width ) / 2;
}
......@@ -719,14 +719,14 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
whole rectangle area or it's taller than the rectangle */
p_region->i_y = p_sys->i_yoffset
+ i_row * ( p_sys->i_height / p_sys->i_rows )
+ ( i_row * p_sys->i_hborder ) / p_sys->i_rows;
+ ( i_row * p_sys->i_borderh ) / p_sys->i_rows;
}
else
{
/* center the video in the dedicated rectangle */
p_region->i_y = p_sys->i_yoffset
+ i_row * ( p_sys->i_height / p_sys->i_rows )
+ ( i_row * p_sys->i_hborder ) / p_sys->i_rows
+ ( i_row * p_sys->i_borderh ) / p_sys->i_rows
+ ( row_inner_height - fmt_out.i_height ) / 2;
}
......@@ -811,20 +811,20 @@ static int MosaicCallback( vlc_object_t *p_this, char const *psz_var,
p_sys->i_align = newval.i_int;
vlc_mutex_unlock( &p_sys->lock );
}
else if( !strcmp( psz_var, "mosaic-vborder" ) )
else if( !strcmp( psz_var, "mosaic-borderw" ) )
{
vlc_mutex_lock( &p_sys->lock );
msg_Dbg( p_this, "changing vertical border from %dpx to %dpx",
p_sys->i_vborder, newval.i_int );
p_sys->i_vborder = __MAX( newval.i_int, 0 );
msg_Dbg( p_this, "changing border width from %dpx to %dpx",
p_sys->i_borderw, newval.i_int );
p_sys->i_borderw = __MAX( newval.i_int, 0 );
vlc_mutex_unlock( &p_sys->lock );
}
else if( !strcmp( psz_var, "mosaic-hborder" ) )
else if( !strcmp( psz_var, "mosaic-borderh" ) )
{
vlc_mutex_lock( &p_sys->lock );
msg_Dbg( p_this, "changing horizontal border from %dpx to %dpx",
p_sys->i_vborder, newval.i_int );
p_sys->i_hborder = __MAX( newval.i_int, 0 );
msg_Dbg( p_this, "changing border height from %dpx to %dpx",
p_sys->i_borderh, newval.i_int );
p_sys->i_borderh = __MAX( newval.i_int, 0 );
vlc_mutex_unlock( &p_sys->lock );
}
else if( !strcmp( psz_var, "mosaic-position" ) )
......
......@@ -1094,6 +1094,7 @@ static int CreateWindow( vout_thread_t *p_vout, x11_window_t *p_win )
XStoreName( p_vout->p_sys->p_display,
p_win->base_window, val.psz_string );
}
if( val.psz_string ) free( val.psz_string );
}
}
}
......@@ -1995,7 +1996,7 @@ static int InitDisplay( vout_thread_t *p_vout )
XPixmapFormatValues * p_formats; /* pixmap formats */
XVisualInfo * p_xvisual; /* visuals information */
XVisualInfo xvisual_template; /* visual template */
int i_count; /* array size */
int i_count, i; /* array size */
#endif
#ifdef HAVE_SYS_SHM_H
......@@ -2101,21 +2102,23 @@ static int InitDisplay( vout_thread_t *p_vout )
p_formats = XListPixmapFormats( p_vout->p_sys->p_display, &i_count );
p_vout->p_sys->i_bytes_per_pixel = 0;
for( ; i_count-- ; p_formats++ )
for( i = 0; i < i_count; i++ )
{
/* Under XFree4.0, the list contains pixmap formats available
* through all video depths ; so we have to check against current
* depth. */
if( p_formats->depth == (int)p_vout->p_sys->i_screen_depth )
if( p_formats[i].depth == (int)p_vout->p_sys->i_screen_depth )
{
if( p_formats->bits_per_pixel / 8
if( p_formats[i].bits_per_pixel / 8
> (int)p_vout->p_sys->i_bytes_per_pixel )
{
p_vout->p_sys->i_bytes_per_pixel =
p_formats->bits_per_pixel / 8;
p_formats[i].bits_per_pixel / 8;
}
}
}
if( p_formats ) XFree( p_formats );
break;
}
p_vout->p_sys->p_visual = p_xvisual->visual;
......
......@@ -888,6 +888,7 @@ static int Init( input_thread_t * p_input, vlc_bool_t b_quick )
{
TAB_APPEND( p_input->i_slave, p_input->slave, sub );
}
else free( sub );
}
free( subs[i] );
}
......@@ -923,6 +924,7 @@ static int Init( input_thread_t * p_input, vlc_bool_t b_quick )
{
TAB_APPEND( p_input->i_slave, p_input->slave, slave );
}
else free( slave );
psz = psz_delim;
}
}
......@@ -1710,6 +1712,7 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type,
}
else
{
free( slave );
msg_Warn( p_input, "failed to add %s as slave",
val.psz_string );
}
......@@ -2700,6 +2703,7 @@ vlc_bool_t input_AddSubtitles( input_thread_t *p_input, char *psz_subtitle,
var_Change( p_input, "spu-es", VLC_VAR_FREELIST, &list, NULL );
}
}
else free( sub );
return VLC_TRUE;
}
......@@ -1550,7 +1550,7 @@ char * stream_ReadLine( stream_t *s )
}
/* Remove trailing LF/CR */
while( i_line > 0 && ( p_line[i_line-2] == '\r' ||
while( i_line >= 2 && ( p_line[i_line-2] == '\r' ||
p_line[i_line-2] == '\n') ) i_line--;
/* Make sure the \0 is there */
......
......@@ -275,7 +275,7 @@ int __var_Create( vlc_object_t *p_this, const char *psz_name, int i_type )
vlc_value_t val;
if( InheritValue( p_this, psz_name, &val, p_var->i_type )
== VLC_SUCCESS );
== VLC_SUCCESS )
{
/* Free data if needed */
p_var->pf_free( &p_var->val );
......@@ -619,7 +619,7 @@ int __var_Change( vlc_object_t *p_this, const char *psz_name,
vlc_value_t val;
if( InheritValue( p_this, psz_name, &val, p_var->i_type )
== VLC_SUCCESS );
== VLC_SUCCESS )
{
/* Duplicate already done */
......
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