Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas George <george@nsup.org>2015-10-25 21:48:10 +0300
committerNicolas George <george@nsup.org>2015-10-30 12:55:10 +0300
commite8e7eb150f152c9e4858ef0be3e76e4f98533cf6 (patch)
treedb04ccb9db76de4d3f2c55ffa7d94084cec7bf9d /ffmpeg_filter.c
parentb38e685c053786bc20743cc6b3e54e6ae1fe957b (diff)
ffmpeg_filter: check encoder before using it to set frame size.
Fix a segfault when no encoder is found for a default codec with a complex filter graph.
Diffstat (limited to 'ffmpeg_filter.c')
-rw-r--r--ffmpeg_filter.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c
index 10b2f5f722..9142a97e8f 100644
--- a/ffmpeg_filter.c
+++ b/ffmpeg_filter.c
@@ -1046,6 +1046,13 @@ int configure_filtergraph(FilterGraph *fg)
for (i = 0; i < fg->nb_outputs; i++) {
OutputStream *ost = fg->outputs[i]->ost;
+ if (!ost->enc) {
+ /* identical to the same check in ffmpeg.c, needed because
+ complex filter graphs are initialized earlier */
+ av_log(NULL, AV_LOG_ERROR, "Encoder (codec %s) not found for output stream #%d:%d\n",
+ avcodec_get_name(ost->st->codec->codec_id), ost->file_index, ost->index);
+ return AVERROR(EINVAL);
+ }
if (ost &&
ost->enc->type == AVMEDIA_TYPE_AUDIO &&
!(ost->enc->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE))