]> git.sesse.net Git - mlt/commitdiff
fix out-of-bounds read (coverity-709368)
authorDan Dennedy <dan@dennedy.org>
Mon, 23 Jul 2012 01:58:04 +0000 (18:58 -0700)
committerDan Dennedy <dan@dennedy.org>
Mon, 23 Jul 2012 01:58:04 +0000 (18:58 -0700)
src/modules/avformat/producer_avformat.c

index 7f5d02d482eb6ce6d81e347c34ccc65c3beb4a6d..2254ad1d06bd805ea43d910a058c7f4d426b64da 100644 (file)
@@ -2359,7 +2359,7 @@ static int producer_get_audio( mlt_frame frame, void **buffer, mlt_audio_format
 
                        // We only deal with audio from the selected audio index
                        index = pkt.stream_index;
-                       if ( ret >= 0 && pkt.data && pkt.size > 0 && ( index == self->audio_index ||
+                       if ( index < MAX_AUDIO_STREAMS && ret >= 0 && pkt.data && pkt.size > 0 && ( index == self->audio_index ||
                                 ( self->audio_index == INT_MAX && context->streams[ index ]->codec->codec_type == CODEC_TYPE_AUDIO ) ) )
                        {
                                int channels2 = ( self->audio_index == INT_MAX || !self->audio_resample[index] ) ?