Commit 965b8072 authored by Robert Nagy's avatar Robert Nagy Committed by Michael Niedermayer

vf_yadif: Fixed potential access violation on EOF.

The correct invariant is (cur != NULL -> next != NULL). Not the other way around.
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 1dd71e1c
......@@ -17,6 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "libavutil/avassert.h"
#include "libavutil/cpu.h"
#include "libavutil/common.h"
#include "libavutil/pixdesc.h"
......@@ -238,6 +239,8 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
AVFilterContext *ctx = link->dst;
YADIFContext *yadif = ctx->priv;
av_assert0(picref);
if (yadif->frame_pending)
return_frame(ctx, 1);
......@@ -308,7 +311,7 @@ static int request_frame(AVFilterLink *link)
ret = avfilter_request_frame(link->src->inputs[0]);
if (ret == AVERROR_EOF && yadif->next) {
if (ret == AVERROR_EOF && yadif->cur) {
AVFilterBufferRef *next = avfilter_ref_buffer(yadif->next, AV_PERM_READ);
next->pts = yadif->next->pts * 2 - yadif->cur->pts;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment