summaryrefslogtreecommitdiff
path: root/libavfilter/vf_pad.c
diff options
context:
space:
mode:
authorXi Wang <xi.wang@gmail.com>2013-03-09 22:39:32 -0500
committerStefano Sabatini <stefasab@gmail.com>2013-03-10 10:38:42 +0100
commit969e8d35b5b4c457b33df524ca95cd548a404599 (patch)
tree17d876f7985ae27069f633f321eb520cee1a0fac /libavfilter/vf_pad.c
parent65fc80f0121dd1514160defb97a8bbcab072c58b (diff)
downloadffmpeg-969e8d35b5b4c457b33df524ca95cd548a404599.tar.gz
lavfi/pad: avoid buffer overflow in buffer_needs_copy()
Replace & with short-circuit &&. Signed-off-by: Xi Wang <xi.wang@gmail.com> Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
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 86fd683ce2..3f4a4f0dfa 100644
--- a/libavfilter/vf_pad.c
+++ b/libavfilter/vf_pad.c
@@ -300,7 +300,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 = s->draw.hsub[planes[j]];
uint8_t *start1 = frame->data[planes[j]];
uint8_t *end1 = start1 + (frame->height >> hsub1) *