aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-14 23:43:34 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-14 23:56:51 +0100
commitc3fb20bab4f00621733809fb35ee39a5ae11e598 (patch)
treee90cd60baa80fae7eeaced01361e0d524ba63d2a /ffmpeg.c
parentd5ce725cb32ba932cdede102f246d060460786cb (diff)
downloadffmpeg-c3fb20bab4f00621733809fb35ee39a5ae11e598.tar.gz
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>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 6817f9cca7..6c3994f0d4 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -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: