summaryrefslogtreecommitdiff
path: root/libavfilter/src_movie.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-03-18 03:57:41 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-03-18 03:59:20 +0100
commit48f7d5f0cfd246642f8e3d695152ceb69d27852f (patch)
tree27b5baffb3db50d8b72b150d4baef79fc1837d0b /libavfilter/src_movie.c
parentaa86cccd11458bdf5265c64ca969286bb044e012 (diff)
avfilter/src_movie: Check that the pixel format hasnt changed
Fixes assertion failure Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/src_movie.c')
-rw-r--r--libavfilter/src_movie.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c
index a1bb843166..82bcc56f3d 100644
--- a/libavfilter/src_movie.c
+++ b/libavfilter/src_movie.c
@@ -540,6 +540,16 @@ static int movie_push_frame(AVFilterContext *ctx, unsigned out_id)
av_dlog(ctx, "movie_push_frame(): file:'%s' %s\n", movie->file_name,
describe_frame_to_str((char[1024]){0}, 1024, movie->frame, frame_type, outlink));
+ if (st->st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
+ if (movie->frame->format != outlink->format) {
+ av_log(ctx, AV_LOG_ERROR, "Format changed %s -> %s, discarding frame\n",
+ av_get_pix_fmt_name(outlink->format),
+ av_get_pix_fmt_name(movie->frame->format)
+ );
+ av_frame_free(&movie->frame);
+ return 0;
+ }
+ }
ret = ff_filter_frame(outlink, movie->frame);
movie->frame = NULL;