}
// Initialize the resamplers and buffers
- for ( ; index < index_max; index++ )
+ for ( ; index < index_max && index < MAX_AUDIO_STREAMS; index++ )
{
// Get codec context
AVCodecContext *codec_context = self->audio_codec[ index ];
else if ( context && index > -1 && audio_codec_init( self, index, properties ) )
{
// Set the frame properties
- if ( index < INT_MAX )
+ if ( index < MAX_AUDIO_STREAMS )
{
mlt_properties_set_int( frame_properties, "frequency", self->audio_codec[ index ]->sample_rate );
mlt_properties_set_int( frame_properties, "channels", self->audio_codec[ index ]->channels );