# include "config.h"
#endif
+#include <assert.h>
+
#include <vlc_common.h>
#include <vlc_plugin.h>
+#include <vlc_memory.h>
#include <errno.h>
#include <sys/types.h>
p_demux->pf_demux = Demux;
p_demux->pf_control = Control;
p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) );
+ assert( p_sys );
p_sys->i_length = 0;
p_sys->p_vobsub_stream = NULL;
p_sys->i_tracks = 0;
p_sys->track = (vobsub_track_t *)malloc( sizeof( vobsub_track_t ) );
+ assert( p_sys->track );
p_sys->i_original_frame_width = -1;
p_sys->i_original_frame_height = -1;
p_sys->b_palette = false;
language, &i_track_id ) == 2 )
{
p_sys->i_tracks++;
- p_sys->track = realloc( p_sys->track, sizeof( vobsub_track_t ) * (p_sys->i_tracks + 1 ) );
+ p_sys->track = realloc_or_free( p_sys->track,
+ sizeof( vobsub_track_t ) * (p_sys->i_tracks + 1 ) );
+ assert( p_sys->track );
language[2] = '\0';
/* Init the track */
current_tk->i_current_subtitle = 0;
current_tk->i_subtitles = 0;
current_tk->p_subtitles = malloc( sizeof( subtitle_t ) );;
+ assert( current_tk->p_subtitles );
current_tk->i_track_id = i_track_id;
current_tk->i_delay = (int64_t)0;
i_location = loc;
current_tk->i_subtitles++;
- current_tk->p_subtitles = realloc( current_tk->p_subtitles, sizeof( subtitle_t ) * (current_tk->i_subtitles + 1 ) );
+ current_tk->p_subtitles =
+ realloc_or_free( current_tk->p_subtitles,
+ sizeof( subtitle_t ) * (current_tk->i_subtitles + 1 ) );
+ assert( current_tk->p_subtitles );
current_sub = ¤t_tk->p_subtitles[current_tk->i_subtitles - 1];
current_sub->i_start = i_start * i_sign;