From 0cc5011f9a1b05132f9a20a71feb031f30a8a53b Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 3 Dec 2013 04:08:37 +0100 Subject: avfilter/vf_pad: fix req_end Fixes out of array accesses Fixes Ticket3190 Signed-off-by: Michael Niedermayer --- libavfilter/vf_pad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavfilter/vf_pad.c') diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c index 2740c634db..2962e204f0 100644 --- a/libavfilter/vf_pad.c +++ b/libavfilter/vf_pad.c @@ -251,7 +251,7 @@ static int buffer_needs_copy(PadContext *s, AVFrame *frame, AVBufferRef *buf) (s->y >> vsub) * frame->linesize[planes[i]]; ptrdiff_t req_end = ((s->w - s->x - frame->width) >> hsub) * s->draw.pixelstep[planes[i]] + - (s->y >> vsub) * frame->linesize[planes[i]]; + ((s->h - s->y - frame->height) >> vsub) * frame->linesize[planes[i]]; if (frame->linesize[planes[i]] < (s->w >> hsub) * s->draw.pixelstep[planes[i]]) return 1; -- cgit v1.2.3