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;
i_frame_size = R16( &p_data, &i_data );
i_subpacket_size = R16( &p_data, &i_data );
if( !i_frame_size || !i_coded_frame_size )
+ {
+ es_format_Clean( &fmt );
return VLC_EGENERIC;
+ }
RVoid( &p_data, &i_data, 2 + (i_version == 5 ? 6 : 0 ) );
break;
case VLC_FOURCC('2','8','_','8'):
+ if( i_coded_frame_size <= 0 )
+ {
+ es_format_Clean( &fmt );
+ return VLC_EGENERIC;
+ }
fmt.i_codec = VLC_CODEC_RA_288;
fmt.audio.i_blockalign = i_coded_frame_size;
break;
case VLC_FOURCC( 's','i','p','r' ):
fmt.i_codec = VLC_CODEC_SIPR;
if( i_flavor > 3 )
+ {
+ msg_Dbg( p_demux, " - unsupported sipr flavorc=%i", i_flavor );
+ es_format_Clean( &fmt );
return VLC_EGENERIC;
+ }
i_subpacket_size = i_subpacket_size_sipr[i_flavor];
// The libavcodec sipr decoder requires stream bitrate
break;
case VLC_FOURCC('r','a','l','f'):
- msg_Dbg( p_demux, " - audio codec not supported=%4.4s",
- (char*)&fmt.i_codec );
- break;
-
default:
msg_Dbg( p_demux, " - unknown audio codec=%4.4s",
- (char*)&fmt.i_codec );
+ (char*)&fmt.i_codec );
+ es_format_Clean( &fmt );
+ return VLC_EGENERIC;
break;
}
msg_Dbg( p_demux, " - extra data=%d", fmt.i_extra );