aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_pad.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-12-03 04:08:37 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2013-12-03 09:52:23 +0100
commitcbcc18bd9f9456c38bb4172749692bb5dbed12f5 (patch)
tree067d93e25dd4b750f11966db2073314c4469cbbe /libavfilter/vf_pad.c
parentc765b6464139b0178dea56f86dca48f94f1dc56c (diff)
downloadffmpeg-cbcc18bd9f9456c38bb4172749692bb5dbed12f5.tar.gz
avfilter/vf_pad: fix req_end
Fixes out of array accesses Fixes Ticket3190 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 0cc5011f9a1b05132f9a20a71feb031f30a8a53b)
Diffstat (limited to 'libavfilter/vf_pad.c')
-rw-r--r--libavfilter/vf_pad.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c
index bb556c9403..45921057dd 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;