summaryrefslogtreecommitdiff
path: root/libavfilter/vf_pad.c
diff options
context:
space:
mode:
authorXi Wang <xi.wang@gmail.com>2013-03-09 22:34:27 -0500
committerLuca Barbato <lu_zero@gentoo.org>2013-03-10 11:16:10 +0100
commit5d639b2b4a6d1f5710cfe247dea4d4c6debdfe0d (patch)
tree398fe4152084a26df3474455272b60e582c5e4ea /libavfilter/vf_pad.c
parent2eaa3663fda750dac66d41fe8541a8744d5563a4 (diff)
vf_pad: fix a & instead of && typo
Avoid buffer overflow in buffer_needs_copy() Signed-off-by: Xi Wang <xi.wang@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
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 1c969e59a9..4489817367 100644
--- a/libavfilter/vf_pad.c
+++ b/libavfilter/vf_pad.c
@@ -316,7 +316,7 @@ static int buffer_needs_copy(PadContext *s, AVFrame *frame, AVBufferRef *buf)
return 1;
#define SIGN(x) ((x) > 0 ? 1 : -1)
- for (j = 0; j < FF_ARRAY_ELEMS(planes) & planes[j] >= 0; j++) {
+ for (j = 0; j < FF_ARRAY_ELEMS(planes) && planes[j] >= 0; j++) {
int hsub1 = (planes[j] == 1 || planes[j] == 2) ? s->hsub : 0;
uint8_t *start1 = frame->data[planes[j]];
uint8_t *end1 = start1 + (frame->height >> hsub1) *