if( tk->p_subpackets[ j ] )
block_Release( tk->p_subpackets[ j ] );
}
- if( tk->i_subpackets )
- {
- free( tk->p_subpackets );
- free( tk->p_subpackets_timecode );
- }
+ free( tk->p_subpackets );
+ free( tk->p_subpackets_timecode );
if( tk->p_sipr_packet )
block_Release( tk->p_sipr_packet );
free( tk );
for( int i = 0; i < i_num; i++ )
{
+ int i_index = tk->i_subpacket_h * i +
+ ((tk->i_subpacket_h + 1) / 2) * (y&1) + (y>>1);
+ if( i_index >= tk->i_subpackets )
+ return;
+
block_t *p_block = block_New( p_demux, tk->i_subpacket_size );
if( !p_block )
return;
p_buf += tk->i_subpacket_size;
- int i_index = tk->i_subpacket_h * i +
- ((tk->i_subpacket_h + 1) / 2) * (y&1) + (y>>1);
-
if( tk->p_subpackets[i_index] != NULL )
{
msg_Dbg(p_demux, "p_subpackets[ %d ] not null!", i_index );
for( int i = 0; i < tk->i_subpacket_h / 2; i++ )
{
+ int i_index = (i * 2 * tk->i_frame_size / tk->i_coded_frame_size) + y;
+ if( i_index >= tk->i_subpackets )
+ return;
+
block_t *p_block = block_New( p_demux, tk->i_coded_frame_size);
if( !p_block )
return;
if( &p_buf[tk->i_coded_frame_size] > &p_sys->buffer[p_sys->i_buffer] )
return;
- int i_index = (i * 2 * tk->i_frame_size / tk->i_coded_frame_size) + y;
-
memcpy( p_block->p_buffer, p_buf, tk->i_coded_frame_size );
p_block->i_dts =
p_block->i_pts = i_index == 0 ? i_pts : VLC_TS_INVALID;