diff options
author | Paul B Mahol <onemda@gmail.com> | 2016-09-08 10:53:43 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2016-09-08 10:56:30 +0200 |
commit | ae31ab807001e6e90eac5a79ee0b61c5e727138c (patch) | |
tree | add9eeede86a4d3be8cf90194ef86569b4886b08 | |
parent | 8cfe60ef3933c4e300cb088fec28b2511df45398 (diff) | |
download | ffmpeg-ae31ab807001e6e90eac5a79ee0b61c5e727138c.tar.gz |
avfilter/vf_shuffleframes: unbreak filter
Regression since 736e2e2c30088d0c2a428a51372c78a0bfb7f356.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
-rw-r--r-- | libavfilter/vf_shuffleframes.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/libavfilter/vf_shuffleframes.c b/libavfilter/vf_shuffleframes.c index f49c9c6049..bfbf4bd268 100644 --- a/libavfilter/vf_shuffleframes.c +++ b/libavfilter/vf_shuffleframes.c @@ -84,14 +84,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) { AVFilterContext *ctx = inlink->dst; ShuffleFramesContext *s = ctx->priv; - int ret; + int ret = 0; if (s->in_frames < s->nb_frames) { s->frames[s->in_frames] = frame; s->pts[s->in_frames] = frame->pts; s->in_frames++; - ret = 0; - } else if (s->in_frames == s->nb_frames) { + } + + if (s->in_frames == s->nb_frames) { int n, x; for (n = 0; n < s->nb_frames; n++) { @@ -108,8 +109,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) for (n = 0; n < s->nb_frames; n++) av_frame_free(&s->frames[n]); - } else - av_assert0(0); + } return ret; } @@ -118,6 +118,11 @@ static av_cold void uninit(AVFilterContext *ctx) { ShuffleFramesContext *s = ctx->priv; + while (s->in_frames > 0) { + s->in_frames--; + av_frame_free(&s->frames[s->in_frames]); + } + av_freep(&s->frames); av_freep(&s->map); av_freep(&s->pts); |