1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-08-27 11:51:49 +02:00

ffmpeg: Check for parameter changes at the output of the audio filter graph

It is currently possible that such changes leak through from the decoder as
well as a filter could generate such changes itself.
This commit blocks such changed packets unless the encoder declares support.

Fixes out of array reads

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-02-14 23:43:34 +01:00
parent d5ce725cb3
commit c3fb20bab4

View File

@ -1102,6 +1102,12 @@ static int reap_filters(void)
case AVMEDIA_TYPE_AUDIO:
avfilter_copy_buf_props(filtered_frame, picref);
filtered_frame->pts = frame_pts;
if (!(ost->st->codec->codec->capabilities & CODEC_CAP_PARAM_CHANGE) &&
ost->st->codec->channels != av_frame_get_channels(filtered_frame)) {
av_log(NULL, AV_LOG_ERROR,
"Audio filter graph output is not normalized and encoder does not support parameter changes\n");
break;
}
do_audio_out(of->ctx, ost, filtered_frame);
break;
default: